Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5e6df9f

Browse files
Three Hundred - Thirty-Six Commit: Implement display_adjacent_matrix() function
1 parent 5656b61 commit 5e6df9f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎Section_12(Graphs)/(1)_graph.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,8 @@ def indegree(self, v):
9494
for i in range(self._vertices):
9595
if self._adjacent_matrix[i][v] != 0:
9696
count = count + 1
97-
return count
97+
return count
98+
99+
# Helper function to display adjacency matrix
100+
def display_adjacent_matrix(self):
101+
print(self._adjacent_matrix)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /