This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Complexity: O(E + V) | |
Tarjan's algorithm for finding strongly connected | |
components. | |
*d[i] = Discovery time of node i. (Initialize to -1) | |
*low[i] = Lowest discovery time reachable from node | |
i. (Doesn't need to be initialized) | |
*scc[i] = Strongly connected component of node i. (Doesn't | |
need to be initialized) | |
*s = Stack used by the algorithm (Initialize to an empty |