Algorithms...... Graphs


#1

The most efficient algorithm for finding the number of connected components in an undirected graph of n vertices and m edges has time complexity ___


#2

You shall do DFS. It will take O(n+m) time.


#3

Yes we can also apply the Dijkstras algorithm and the answer is correct