In this video, we will write a python program to count number of connected components in an undirected graph.
Here, we will see the algorithm to count the number of connected components in an undirected graph using depth-first-search. It visits all vertices of a connected component when it is called on a vertex of that connected component.