public static void main(String[] args) { @SuppressWarnings("unchecked") List<Integer>[] g = new List[10]; for (int i = 0; i < g.length; i++) { g[i] = new ArrayList<>(); } g[0].add(1); g[0].add(2); g[2].add(1); g[1].add(2); g[3].add(2); g[4].add(3); g[5].add(4); g[6].add(5); g[7].add(6); g[8].add(9); g[9].add(7); List<List<Integer>> components = new SCCTarjan().scc(g); System.out.println(components); } }
List<List<Integer>> components = new SCCTarjan().scc(predecessors);
List<List<Integer>> components = new SCCTarjan().scc(predecessors);