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 56dbca8 commit f943bddCopy full SHA for f943bdd
1 file changed
graphs/check_bipatrite.py
@@ -48,9 +48,7 @@ def is_bipartite_dfs(graph: defaultdict[int, list[int]]) -> bool:
48
>>> is_bipartite_dfs({0: [1.0, 3.0], 1.0: [0, 2.0], 2.0: [1.0, 3.0], 3.0: [0, 2.0]})
49
True
50
>>> 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
+ True
54
>>> is_bipartite_dfs({0: ["b", "d"], 1: ["a", "c"], 2: ["b", "d"], 3: ["a", "c"]})
55
Traceback (most recent call last):
56
...
@@ -132,9 +130,7 @@ def is_bipartite_bfs(graph: defaultdict[int, list[int]]) -> bool:
132
130
>>> is_bipartite_bfs({0: [1.0, 3.0], 1.0: [0, 2.0], 2.0: [1.0, 3.0], 3.0: [0, 2.0]})
133
131
134
>>> is_bipartite_bfs({"a": [1, 3], "b": [0, 2], "c": [1, 3], "d": [0, 2]})
135
136
137
138
>>> is_bipartite_bfs({0: ["b", "d"], 1: ["a", "c"], 2: ["b", "d"], 3: ["a", "c"]})
139
140
0 commit comments