mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-06-17 03:19:22 -04:00
Update dfs.py
This commit is contained in:
parent
c8fad05719
commit
cc05ef2ea8
1 changed files with 1 additions and 2 deletions
|
@ -29,8 +29,7 @@ def dfs(graph, v, discovered):
|
||||||
|
|
||||||
def iterative_dfs(graph, v, discovered):
|
def iterative_dfs(graph, v, discovered):
|
||||||
|
|
||||||
stack = deque()
|
stack = [v]
|
||||||
stack.append(v)
|
|
||||||
|
|
||||||
while stack:
|
while stack:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue