The most efficient algorithm for finding the number of connected components in an undirected graph on $n$ vertices and $m$ edges has time complexity
Run DFS to find connected components. Its time complexity is $\Theta(m+n)$, hence (C) is the answer.
The explanation of this ans can be find in :
see first 15 minuets portion
I am also facing the same problem my ...