Modify the problem of preorder_traversal_iii

This commit is contained in:
krahets
2023-07-19 16:37:12 +08:00
parent 4e13755023
commit c54536d1a1
10 changed files with 15 additions and 3 deletions

View File

@ -21,6 +21,7 @@ fn pre_order(res: &mut Vec<Vec<Rc<RefCell<TreeNode>>>>, path: &mut Vec<Rc<RefCel
if node.borrow().val == 7 {
// 记录解
res.push(path.clone());
return;
}
pre_order(res, path, node.borrow().left.clone());
pre_order(res, path, node.borrow().right.clone());