Make DFS file Python3 compatible

This commit is contained in:
lierluis 2017-10-05 01:16:27 -07:00
parent ca09b78a8f
commit 9264ba379f

View File

@ -7,7 +7,7 @@ class GRAPH:
def show(self):
print self.graph
print(self.graph)
def add_edge(self, i, j):
self.graph[i][j]=1
@ -26,7 +26,7 @@ g=GRAPH(n)
e=int(input("Enter the no of edges : "))
print("Enter the edges (u v)")
for i in range(0,e):
u,v=map(int, raw_input().split())
u,v=map(int, input().split())
g.add_edge(u,v)
s=int(input("Enter the source node :"))
g.dfs(s)