Skip to content

Commit f943bdd

Browse files
Update check_bipatrite.py
1 parent 56dbca8 commit f943bdd

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

graphs/check_bipatrite.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ def is_bipartite_dfs(graph: defaultdict[int, list[int]]) -> bool:
4848
>>> is_bipartite_dfs({0: [1.0, 3.0], 1.0: [0, 2.0], 2.0: [1.0, 3.0], 3.0: [0, 2.0]})
4949
True
5050
>>> is_bipartite_dfs({"a": [1, 3], "b": [0, 2], "c": [1, 3], "d": [0, 2]})
51-
Traceback (most recent call last):
52-
...
53-
KeyError: 1
51+
True
5452
>>> is_bipartite_dfs({0: ["b", "d"], 1: ["a", "c"], 2: ["b", "d"], 3: ["a", "c"]})
5553
Traceback (most recent call last):
5654
...
@@ -132,9 +130,7 @@ def is_bipartite_bfs(graph: defaultdict[int, list[int]]) -> bool:
132130
>>> is_bipartite_bfs({0: [1.0, 3.0], 1.0: [0, 2.0], 2.0: [1.0, 3.0], 3.0: [0, 2.0]})
133131
True
134132
>>> is_bipartite_bfs({"a": [1, 3], "b": [0, 2], "c": [1, 3], "d": [0, 2]})
135-
Traceback (most recent call last):
136-
...
137-
KeyError: 1
133+
True
138134
>>> is_bipartite_bfs({0: ["b", "d"], 1: ["a", "c"], 2: ["b", "d"], 3: ["a", "c"]})
139135
Traceback (most recent call last):
140136
...

0 commit comments

Comments
 (0)