Traversing for every vertex
visited = [ False for i in range ( V + 1 ) ] NEW_LINE for u in range ( 1 , V + 1 ) : NEW_LINE INDENT if ( visited [ u ] == False ) : NEW_LINE INDENT componentMax = u NEW_LINE componentMin = u NEW_LINE visited , componentMax , componentMin = DFSUtil ( u , adj , visited , componentMin , componentMax ) NEW_LINE DEDENT DEDENT