MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / path

Method path

HackerEarth_problems/Edges on a path/solution.py:64–79  ·  view source on GitHub ↗
(self,x,y)

Source from the content-addressed store, hash-verified

62 #parent arr means for given edge V -- > u in arr[u] = v
63
64 def path(self,x,y):
65 q = deque()
66 visited = [False] * (self.V)
67 q.append(x)
68 parent = [-1] * (self.V)
69 while(len(q)>0):
70 u = q.popleft()
71 for v in self.graph[u]:
72 if(v == y):
73 visited[v] = True
74 parent[v] = u
75 return parent
76 if(visited[v] == False):
77 q.append(v)
78 visited[v] = True
79 parent[v] = u
80
81
82

Callers 1

solution.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected