Tarjan's algorithm for computing strongly connected components