Skip to content

Commit 55e0b0f

Browse files
ziyzhupoyea
authored andcommitted
Corrected wrong DFS implementation (#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

Lines changed: 0 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy