<awangdev>207. Course Schedule_2.java
private boolean dfs(List[] edges, int[] visited, int node) {

        if (visited[node] == 1) return true;
        if (visited[node] == -1) return false; 
        
        visited[node] = -1;
        List<Integer> childNodes = edges[node];
        for (int childNode : childNodes) {
            if (!dfs(edges, visited, childNode)) return false;
        }
        visited[node] = 1;
        
        return true;
    }
private boolean sample_funcname ( List [ ] edges , int [ ] visited , int node ) {
  if ( visited [ node ] == 1 ) return true ;
  if ( visited [ node ] == - 1 ) return false ;
  visited [ node ] = - 1 ;
  List < Integer > childNodes = edges [ node ] ;
  for ( int childNode : childNodes ) {
    if ( ! dfs ( edges , visited , childNode ) ) return false ;
  }
  visited [ node ] = 1 ;
  return true ;
}
