AlgoBazaAlgoBaza
Back to algorithms

Bipartite Check

The algorithm checks whether an undirected graph is bipartite — meaning vertices can be split into two groups so that every edge connects vertices from different groups. Uses DFS with vertex coloring.

Sredni
O(V+E)O(V)OIJOI

◐ Bipartite Check — Games

Play both games to master the algorithm!

💡

Tip: Start with Game 1 to understand what a bipartite graph is. In Game 2 you run the algorithm yourself, step by step — exactly like tracing code on paper in a contest.