GATE Computer ScienceModerateGATE CS · ISRO

A weighted undirected graph on vertices 0–5 has edges (0,1,4), (0,2,3), (1,2,1), (1,3,2), (2,3,4), (3,4,2), (4,5,6), (3,5,7), (2,5,8) given as (u, v, weight). What is the weight of its minimum spanning tree?

  1. A. 15
  2. B. 13
  3. C. 14
  4. D. 16

Correct answer: C. 14

Kruskal accepts the edges of weight 1, 2, 2, 3 and 6 (all others form cycles), total 14.

More Algorithms questions

Exams that ask this topic