mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-22 00:20:25 -04:00
Update bt_bfs.py
This commit is contained in:
parent
95fd556031
commit
1044a13ad9
1 changed files with 1 additions and 6 deletions
|
@ -8,9 +8,6 @@ def bfs_iterative(root) -> list:
|
|||
result = []
|
||||
queue = collections.deque([root])
|
||||
|
||||
if root is None:
|
||||
return result
|
||||
|
||||
while queue:
|
||||
|
||||
node = queue.popleft()
|
||||
|
@ -26,9 +23,7 @@ def bfs_iterative(root) -> list:
|
|||
def bfs_recursive(root) -> list:
|
||||
|
||||
result = []
|
||||
if root is None:
|
||||
return root
|
||||
|
||||
|
||||
def helper(node):
|
||||
|
||||
if node:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue