mirror of
https://github.com/krahets/hello-algo.git
synced 2026-09-17 20:17:14 +00:00
Fix the code of preorder_traversal_iii_compact
This commit is contained in:
@@ -65,7 +65,7 @@ enum PreorderTraversalIIITemplate {
|
||||
var res: [[TreeNode]] = []
|
||||
backtrack(state: &state, choices: [root].compactMap { $0 }, res: &res)
|
||||
|
||||
print("\n输出所有根节点到节点 7 的路径,且路径中不包含值为 3 的节点")
|
||||
print("\n输出所有根节点到节点 7 的路径,路径中不包含值为 3 的节点,仅包含一个值为 7 的节点")
|
||||
for path in res {
|
||||
var vals: [Int] = []
|
||||
for node in path {
|
||||
|
||||
Reference in New Issue
Block a user