We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af60884 commit 2c0ea66Copy full SHA for 2c0ea66
1 file changed
graphs/check_bipatrite.py
@@ -31,9 +31,7 @@ def is_bipartite_dfs(graph: defaultdict[int, list[int]]) -> bool:
31
>>> is_bipartite_dfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]})
32
False
33
>>> 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
+ False
37
38
>>> # FIXME: This test should fails with KeyError: 4.
39
>>> 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:
121
119
>>> is_bipartite_bfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]})
122
120
123
>>> is_bipartite_bfs({7: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]})
124
125
126
127
128
129
>>> is_bipartite_bfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 9: [0]})
0 commit comments