mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-22 08:21:12 -04:00
Update bt_bfs.py
This commit is contained in:
parent
1044a13ad9
commit
f1a8659193
1 changed files with 0 additions and 16 deletions
|
@ -18,19 +18,3 @@ def bfs_iterative(root) -> list:
|
|||
queue.append(node.right)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def bfs_recursive(root) -> list:
|
||||
|
||||
result = []
|
||||
|
||||
def helper(node):
|
||||
|
||||
if node:
|
||||
result.append(node.val)
|
||||
helper(node.left)
|
||||
helper(node.right)
|
||||
|
||||
helper(root)
|
||||
return result
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue