We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07d46a1 commit abf715aCopy full SHA for abf715a
dfs_bfs.py
@@ -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
+
6
def dfs_1(graph, start):
7
visited, stack = set(), [start]
8
while stack:
0 commit comments