Practice45 min
Practice: Ordering & Connectivity
Topological sort with cycle detection and union-find for components, trees, and redundant edges.
Kahn's algorithm twice — first as a yes/no cycle check, then producing the actual order — followed by three union-find drills where the answers fall out of two facts: successful unions reduce the component count by one, and a union that finds both sides already rooted together has just caught a cycle.
Problems0 of 5 solved
- Not startedCourse Schedulecycle detection via topological sort / DFS statesmedium
- Not startedCourse Schedule IItopological sort producing an orderingmedium
- Not startedGraph Valid Treeunion-find (or DFS): n-1 edges + fully connected, no cyclemedium
- Not startedNumber of Connected Components in an Undirected Graphunion-find (or DFS component count)medium
- Not startedRedundant Connectionunion-find — first edge joining an existing setmedium