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 c147003

Browse files
Three Hundred - Thirty-Three Commit: Implement edges_print() function
1 parent ff601f6 commit c147003

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,10 @@ def edge_count(self):
7474
def vertices_print(self):
7575
for i in range(self._vertices):
7676
print(i, end=' ')
77-
print()
77+
print()
78+
79+
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)

0 commit comments

Comments
(0)

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