Finding the maximum and minimum values in each component
componentMax = Math . max ( componentMax , u ) ; componentMin = Math . min ( componentMin , u ) ; for ( var i = 0 ; i < ( adj [ u ] ) . length ; i ++ ) if ( visited [ ( adj [ u ] ) [ i ] ] == false ) DFSUtil ( ( adj [ u ] ) [ i ] , adj , visited , componentMin , componentMax ) ; }