Undirected graph


#1

The most efficient algorithm for finding the number of connected components in an undirected graph on n vertices and m edges has time complexity.
A) \theta(n)
B) \theta(m)
C) \theta(m + n)
D) \theta(mn)


#2

© \theta(m + n) should be the answer


#3

Can you explain me in detail


#4

Use DFS algorithim to find connected components with complexity © \theta(m + n) .