Counts number of vertices connected in a component containing x . Stores the count in k .
def dfs ( graph , visited , x , k ) : NEW_LINE INDENT for i in range ( len ( graph [ x ] ) ) : NEW_LINE INDENT if ( not visited [ graph [ x ] [ i ] ] ) : NEW_LINE DEDENT DEDENT