mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-10 11:00:59 +00:00
Update preorder_traversal_iii.
This commit is contained in:
@@ -41,7 +41,7 @@ public class preorder_traversal_iii_compact {
|
||||
res = new List<List<TreeNode>>();
|
||||
preOrder(root);
|
||||
|
||||
Console.WriteLine("\n输出所有根节点到节点 7 的路径,路径中不包含值为 3 的节点,仅包含一个值为 7 的节点");
|
||||
Console.WriteLine("\n输出所有根节点到节点 7 的路径,路径中不包含值为 3 的节点");
|
||||
foreach (List<TreeNode> path in res) {
|
||||
PrintUtil.PrintList(path.Select(p => p.val).ToList());
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ public class preorder_traversal_iii_template {
|
||||
if (isSolution(state)) {
|
||||
// 记录解
|
||||
recordSolution(state, res);
|
||||
return;
|
||||
}
|
||||
// 遍历所有选择
|
||||
foreach (TreeNode choice in choices) {
|
||||
|
||||
Reference in New Issue
Block a user