We are running the dfs for every node so then the time complexity should be O(n^2)??
Time complexity of kosarajus algo
@shreyaanand2908,
We are not running dfs for every node. We are running dfs for every unvisited node, thus no node will be visited more than ones, thus the complexity is O(n+m)
oh yes, okay.
Thanks.