Function to perform the DFSUtil ( ) for all the unvisited vertices
static void DFS ( int V , boolean [ ] initial , boolean [ ] finall ) { ans = 0 ; visited = new Vector < Boolean > ( ) ; for ( int i = 0 ; i < V ; i ++ ) { visited . add ( false ) ; }