(l,size)
return count
Function that counts the Connected components on bases of DFS.
    return type : int
Function that counts the Connected components on bases of DFS.
    return type : int
Function that counts the Connected components on bases of DFS . return type : int
def count_components(l,size):
    ''' 
    Function that counts the Connected components on bases of DFS.
    return type : int
    '''

    count = 0
    visited = [False]*(size+1)
    for i in range(1,size+1):
        if not visited[i]:
            dfs(i,visited,l)
            count+=1
    return count
def count_components ( l , size ) : count = 0 visited = [ False ] * ( size + 1 ) for i in range ( 1 , size + 1 ) : if not visited [ i ] : dfs ( i , visited , l ) count += 1 return count