...
Engineering-Mathematics
October 5, 2023
GATE 2007
October 5, 2023
Engineering-Mathematics
October 5, 2023
GATE 2007
October 5, 2023

GATE 2008

Question 7

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
θ(n)
B
θ(m)
C
θ(m+n)
D
θ(mn)
Question 7 Explanation: 
To find the number of connected components using either BFS or DFS time complexity is θ(m+n).
Suppose if we are using Adjacency matrix means it takes θ(n2).
Correct Answer: C
Question 7 Explanation: 
To find the number of connected components using either BFS or DFS time complexity is θ(m+n).
Suppose if we are using Adjacency matrix means it takes θ(n2).

Leave a Reply

Your email address will not be published. Required fields are marked *