Why it matters
Kosaraju's is simpler alternative to Tarjan. Same asymptotic; teach-friendly.
Advertisement
The architecture
DFS forward; record finish order.
DFS on reverse in finish order.
Trees = SCCs.
Advertisement
How it works end to end
Two DFS passes.
Reverse graph.
O(V+E).