Method to preprocess all nodes for assigning time
static void preProcess ( int [ , ] edges , int V , int [ ] timeIn , int [ ] timeOut ) { ArrayList [ ] g = new ArrayList [ V ] ; for ( int i = 0 ; i < V ; i ++ ) { g [ i ] = new ArrayList ( ) ; }