Problem Statement: Given a Directed Graph with V vertices (Numbered from 0 to V-1) and E edges, Find the number of strongly connected components in the graph.
Example
Input : 5 5
1 0
0 2
2 1
0 3
3 4
Output : 3
Solution: I'd like to provide a well commented C++ code to this problem with the most optimised time and space complexity of O(V+E). I'd like to add the solution in the 'Graphs' topic folder.
Kindly assign this issue to me and add the necessary labels for HacktoberFest.
Strongly Connected Components (Kosaraju's Algo)
Problem Statement: Given a Directed Graph with V vertices (Numbered from 0 to V-1) and E edges, Find the number of strongly connected components in the graph.
Example
Input
: 5 5 1 0 0 2 2 1 0 3 3 4Output
: 3Solution: I'd like to provide a well commented C++ code to this problem with the most optimised time and space complexity of O(V+E). I'd like to add the solution in the 'Graphs' topic folder.
Kindly assign this issue to me and add the necessary labels for HacktoberFest.