Skip to content

Commit 36955c5

Browse files
modified: graphs/check_bipartite_graph_all.py
1 parent 4364632 commit 36955c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: graphs/check_bipartite_graph_all.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def check_bipartite(graph: dict[int, list[int]])->bool:
2424
visited = [False] * len(graph)
2525
color = [-1] * len(graph)
2626

27-
def bfs()->bool:
27+
def breadth_first_search() -> bool:
2828
while not queue.empty():
2929
u = queue.get()
3030
visited[u] = True
@@ -45,7 +45,7 @@ def bfs()->bool:
4545
if not visited[i]:
4646
queue.put(i)
4747
color[i] = 0
48-
if bfs() is False:
48+
if breadth_first_search() is False:
4949
return False
5050
return True
5151
def is_bipartite(graph: defaultdict[int, list[int]]) -> bool:

0 commit comments

Comments
 (0)