dsa7 min read
Bipartite Check and Graph Coloring — 2-Coloring with BFS or DFS [LC 785, LC 886, Google, Meta]
Master bipartite checking and graph coloring: a single BFS or DFS pass that 2-colors a graph and proves it is bipartite, or finds an odd cycle. The pattern behind LeetCode 785 Is Graph Bipartite and LeetCode 886 Possible Bipartition, asked at Google, Meta, and Amazon.
Read →