Engineering-Mathematics
October 5, 2023GATE 2007
October 5, 2023Data-Structures
Question 59
|
The most efficient algorithm for finding the number of connected components in an undirected graph on n vertices and m edges has time complexity
θ(n)
|
|
θ(m)
|
|
θ(m+n)
|
|
θ(mn)
|
Question 59 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).
Suppose if we are using Adjacency matrix means it takes θ(n2).
Correct Answer: C
Question 59 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).
Suppose if we are using Adjacency matrix means it takes θ(n2).
Subscribe
Login
0 Comments