From a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 27 Jun 2025 12:23:02 -0600 Subject: chore: remove old cpp and rust solutions --- other/binary_tree_preorder.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 other/binary_tree_preorder.rs (limited to 'other/binary_tree_preorder.rs') diff --git a/other/binary_tree_preorder.rs b/other/binary_tree_preorder.rs deleted file mode 100644 index da6e0b8..0000000 --- a/other/binary_tree_preorder.rs +++ /dev/null @@ -1,35 +0,0 @@ -use std::rc::Rc; -use std::cell::RefCell; -#[derive(Debug, PartialEq, Eq)] -pub struct TreeNode { - pub val: i32, - pub left: Option>>, - pub right: Option>>, -} - -impl TreeNode { - #[inline] - pub fn new(val: i32) -> Self { - TreeNode { - val, left: None, - right: None - } - } -} - -struct Solution; - -impl Solution { - pub fn preorder_traversal(root: Option>>) -> Vec { - let mut ans: Vec = Vec::new(); - let mut stack: Vec>>> = vec![root]; - while let Some(last) = stack.pop() { - if let Some(n) = last { - ans.push(n.borrow().val); - stack.push(n.borrow().right.clone()); - stack.push(n.borrow().left.clone()); - } - } - ans - } -} -- cgit v1.2.3