mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Update dfs.py
This commit is contained in:
parent
c8fad05719
commit
cc05ef2ea8
@ -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…
x
Reference in New Issue
Block a user