mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 12:16:14 -04:00
Update trie_preorder.py
This commit is contained in:
parent
728b441734
commit
4e895726bd
@ -11,6 +11,7 @@ def preorder(root: 'Node'):
|
||||
stack, result = [root, ], []
|
||||
|
||||
while stack:
|
||||
|
||||
node = stack.pop()
|
||||
result.append(node.val)
|
||||
stack.extend(node.children[::-1])
|
||||
|
Loading…
x
Reference in New Issue
Block a user