Finding the maximum and minimum values in each component
componentMax = Math . Max ( componentMax , u ) ; componentMin = Math . Min ( componentMin , u ) ; for ( int i = 0 ; i < ( ( ArrayList ) adj [ u ] ) . Count ; i ++ ) if ( visited [ ( int ) ( ( ArrayList ) adj [ u ] ) [ i ] ] == false ) DFSUtil ( ( int ) ( ( ArrayList ) adj [ u ] ) [ i ] , adj , visited , componentMin , componentMax ) ; }