GraphsExplained
Tarjan's Algorithm
One DFS with low-link values and a stack finds all SCCs.
Time
O(V + E)
Extra space
O(V)
Use it for
Strongly connected components in one pass.
One DFS with low-link values and a stack finds all SCCs.
Time
O(V + E)
Extra space
O(V)
Use it for
Strongly connected components in one pass.