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 d97e849

Browse files
Three Hundred - Twenty-Nine Commit: Implement exist_edge() function
1 parent bfcc6d1 commit d97e849

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,7 @@ def insert_edge(self, u, v, weight_edge = 1):
5555
self._adjacent_matrix[u][v] = weight_edge
5656

5757
def remove_edge(self, u, v):
58-
self._adjacent_matrix[u][v] = 0
58+
self._adjacent_matrix[u][v] = 0
59+
60+
def exist_edge(self, u, v):
61+
return self._adjacent_matrix[u][v] != 0

0 commit comments

Comments
(0)

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