Skip to content
Related Articles

Related Articles

GATE | GATE MOCK 2017 | Question 21

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 28 Jun, 2021

Consider a directed graph with n vertices and m edges such that all edges have same edge weights. Find the complexity of the best known algorithm to compute the minimum spanning tree of the graph?

(A) O(m+n)
(B) O(m logn)
(C) O(mn)
(D) O(n logm)

Answer: (A)

Explanation: It’s a special case in which all edge weights are equal, so dfs would work and resultant depth first tree would be the spanning tree. So the answer would be O(m+n).

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!