Skip to content

Commit 2bdd28c

Browse files
authored
Merge pull request #8 from PawanKumar18/patch-1
Update GraphAdjacencyMatrix.py
2 parents 8f1b2be + 57b914b commit 2bdd28c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/chapter09graphs/GraphAdjacencyMatrix.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ def setVertex(self, vtx, id):
4848
def getVertex(self, n):
4949
for vertxin in range(0, self.numVertices):
5050
if n == self.vertices[vertxin].getVertexID():
51-
return vertxin
52-
else:
53-
return -1
51+
return vertxin
52+
return -1
5453

5554
def addEdge(self, frm, to, cost=0):
5655
if self.getVertex(frm) != -1 and self.getVertex(to) != -1:

0 commit comments

Comments
 (0)