Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<List<Integer>> getSCComponents(List<Integer>[] graph)
- {
- V = graph.length;
- this.graph = graph;
- low = new int[V];
- visited = new boolean[V];
- stack = new Stack<Integer>();
- sccComp = new ArrayList<>();
- for (int v = 0; v < V; v++)
- if (!visited[v])
- dfs(v);
- return sccComp;
- }
Advertisement
Add Comment
Please, Sign In to add comment