Method
dfsCount
(int node, boolean[] vis, ArrayList<ArrayList<Integer>> adjT)
Source from the content-addressed store, hash-verified
| 10 | st.push(node); |
| 11 | } |
| 12 | private void dfsCount(int node, boolean[] vis, ArrayList<ArrayList<Integer>> adjT) { |
| 13 | vis[node] = true; |
| 14 | for (Integer it : adjT.get(node)) { |
| 15 | if (!vis[it]) { |
| 16 | dfsCount(it, vis, adjT); |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | //Function to find number of strongly connected components in the graph. |
| 21 | public int kosaraju(int V, ArrayList<ArrayList<Integer>> adj) |
| 22 | { |
Tested by
no test coverage detected