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 3db825c commit bf4ae8bCopy full SHA for bf4ae8b
Data Structures/Graphs/DFS.PY
@@ -1,3 +1,5 @@
1
+# DFS Traversal of Graph using Adjacency Matrix Representation
2
+# Function To implement DFS (Depth First Search)
3
def Depthfirstsearch(matrix,start):
4
visit=[start] #Keep Track of Visited elements
5
stack=[start] #DFS is implemented using stack
@@ -30,4 +32,4 @@ if __name__ == "__main__":
30
32
start=int(input("Enter the starting vertix\n"))
31
33
ans=Depthfirstsearch(matrix,start)
34
print("DFS of the given graph is ",end=" ")
- print(*ans)
35
+ print(*ans)
0 commit comments