This implementation uses the Kosaraju-Sharir algorithm. The constructor takes time proportional to
V + E (in the worst case), where V is the number of vertices and E is the number
of edges. Afterwards, the id, count, and areStronglyConnected operations take constant
time.
This implementation uses the Kosaraju-Sharir algorithm. The constructor takes time proportional to
V + E (in the worst case), where V is the number of vertices and E is the number of edges. Afterwards, the id, count, and areStronglyConnected operations take constant time.