An undirected graph is bipartite if its nodes can be partitioned into two independent sets $A$ and $B$ such that every edge connects a node in $A$ and a node in $B$. Determine if the graph is bipartite.
"A graph is bipartite if and only if it has no odd cycles. Bipartite checking is equivalent to 2-coloring: adjacent nodes must have different colors."
"The graph might be disconnected! We must iterate $i$ from 0 to $n-1$. If node $i$ is uncolored, start a new 2-coloring search assigning color[i] = 0."
"For node $u$, iterate neighbors $v$: if $v$ is uncolored, assign color[v] = 1 - color[u] and enqueue. If $v$ is already colored and color[v] == color[u], return false immediately."
"Every vertex and edge is visited at most once. Time complexity is $O(V + E)$ and space is $O(V)$ for the color array and BFS queue."