We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e2fb22 commit 55e0b0fCopy full SHA for 55e0b0f
graphs/DFS.py
@@ -16,7 +16,6 @@ def dfs(graph, start):
16
to the node's children onto the iterator stack. When the iterator at the top of the stack terminates, we'll pop
17
it off the stack."""
18
explored, stack = set(), [start]
19
- explored.add(start)
20
while stack:
21
v = stack.pop() # one difference from BFS is to pop last element here instead of first one
22
0 commit comments