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

Commit abf715a

Browse files
author
Amogh Singhal
authored
Update dfs_bfs.py
1 parent 07d46a1 commit abf715a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎dfs_bfs.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Given a graph, there are two methods to
2+
# perform traversal on it.
3+
# 1. Depth First Search (DFS)
4+
# 2. Breadth First Search (BFS)
5+
16
def dfs_1(graph, start):
27
visited, stack = set(), [start]
38
while stack:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /