There was an error while loading. Please reload this page.
1 parent c147003 commit d6f1172Copy full SHA for d6f1172
Section_12(Graphs)/(1)_graph.py
@@ -80,4 +80,11 @@ def edges_print(self):
80
for i in range(self._vertices):
81
for j in range(self._vertices):
82
if self._adjacent_matrix[i][j] != 0:
83
- print(i, '--', j)
+ print(i, '--', j)
84
+
85
+ def outdegree(self, v):
86
+ count = 0
87
+ for j in range(self._vertices):
88
+ if self._adjacent_matrix[v][j] != 0:
89
+ count = count + 1
90
+ return count
0 commit comments