PJF16

Tarjan

May 16th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1.  public List<List<Integer>> getSCComponents(List<Integer>[] graph)
  2.     {
  3.         V = graph.length;
  4.         this.graph = graph;
  5.         low = new int[V];
  6.         visited = new boolean[V];
  7.         stack = new Stack<Integer>();
  8.         sccComp = new ArrayList<>();
  9.  
  10.         for (int v = 0; v < V; v++)
  11.               if (!visited[v])
  12.                 dfs(v);
  13.  
  14.         return sccComp;
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment