mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-28 04:42:48 +08:00
Add cpp code for the backtrack algorithm.
This commit is contained in:
@ -32,7 +32,7 @@ public class preorder_find_nodes {
|
||||
res = new ArrayList<>();
|
||||
preOrder(root);
|
||||
|
||||
System.out.println("\n输出所有根节点到节点 7 的路径");
|
||||
System.out.println("\n输出所有值为 7 的节点");
|
||||
List<Integer> vals = new ArrayList<>();
|
||||
for (TreeNode node : res) {
|
||||
vals.add(node.val);
|
||||
|
Reference in New Issue
Block a user