Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit55e0b0f

Browse files
ziyzhupoyea
authored andcommitted
Corrected wrong DFS implementation (#903)
1 parent6e2fb22 commit55e0b0f

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
whilestack:
2120
v=stack.pop()# one difference from BFS is to pop last element here instead of first one
2221

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp