From 9264ba379f5c8aacd46a6833ebf923145040ef66 Mon Sep 17 00:00:00 2001 From: lierluis Date: Thu, 5 Oct 2017 01:16:27 -0700 Subject: [PATCH] Make DFS file Python3 compatible --- data_structures/Graph/Deep_First_Search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data_structures/Graph/Deep_First_Search.py b/data_structures/Graph/Deep_First_Search.py index 656ddfbaf..b1160eb33 100644 --- a/data_structures/Graph/Deep_First_Search.py +++ b/data_structures/Graph/Deep_First_Search.py @@ -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)