Skip to content

Commit 2c0ea66

Browse files
Update check_bipatrite.py
1 parent af60884 commit 2c0ea66

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
@@ -31,9 +31,7 @@ def is_bipartite_dfs(graph: defaultdict[int, list[int]]) -> bool:
3131
>>> is_bipartite_dfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]})
3232
False
3333
>>> is_bipartite_dfs({7: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]})
34-
Traceback (most recent call last):
35-
...
36-
KeyError: 0
34+
False
3735
3836
>>> # FIXME: This test should fails with KeyError: 4.
3937
>>> is_bipartite_dfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 9: [0]})
@@ -121,9 +119,7 @@ def is_bipartite_bfs(graph: defaultdict[int, list[int]]) -> bool:
121119
>>> is_bipartite_bfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]})
122120
False
123121
>>> is_bipartite_bfs({7: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]})
124-
Traceback (most recent call last):
125-
...
126-
KeyError: 0
122+
False
127123
128124
>>> # FIXME: This test should fails with KeyError: 4.
129125
>>> is_bipartite_bfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 9: [0]})

0 commit comments

Comments
 (0)