Connected component algorithm for graph and companion DFS algo
the connected component algorithm for undirected Graph