| 17 | } |
| 18 | |
| 19 | void dfsRec(int node,vector<int> g[],vector<bool> &visited) |
| 20 | { |
| 21 | visited[node]=true; |
| 22 | |
| 23 | for(auto child: g[node]) |
| 24 | { |
| 25 | if(!visited[child]) |
| 26 | { |
| 27 | dfsRec(child,g,visited); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | return; |
| 32 | } |
| 33 | |
| 34 | //Function to find number of strongly connected components in the graph. |
| 35 | int kosaraju(int V, vector<int> adj[]) |