GraphsExplained
Kosaraju's Algorithm
DFS finish order, then DFS on the reversed graph finds each SCC.
Time
O(V + E)
Extra space
O(V)
Use it for
Strongly connected components.
DFS finish order, then DFS on the reversed graph finds each SCC.
Time
O(V + E)
Extra space
O(V)
Use it for
Strongly connected components.