Skip to content

Commit 55e0b0f

Browse files
ziyzhupoyea
authored andcommitted
Corrected wrong DFS implementation (TheAlgorithms#903)
1 parent 6e2fb22 commit 55e0b0f

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

graphs/DFS.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def dfs(graph, start):
1616
to the node's children onto the iterator stack. When the iterator at the top of the stack terminates, we'll pop
1717
it off the stack."""
1818
explored, stack = set(), [start]
19-
explored.add(start)
2019
while stack:
2120
v = stack.pop() # one difference from BFS is to pop last element here instead of first one
2221

0 commit comments

Comments
 (0)