MCPcopy Index your code
hub / github.com/subbarayudu-j/TheAlgorithms-Python / addEdge

Method addEdge

Graphs/graph.py:13–18  ·  view source on GitHub ↗
(self, fromVertex, toVertex)

Source from the content-addressed store, hash-verified

11 self.List = {}
12
13 def addEdge(self, fromVertex, toVertex):
14 # check if vertex is already present
15 if fromVertex in self.List.keys():
16 self.List[fromVertex].append(toVertex)
17 else:
18 self.List[fromVertex] = [toVertex]
19
20 def printList(self):
21 for i in self.List:

Callers 1

graph.pyFile · 0.45

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected