Data Structures & AlgorithmsHardGATE CSE · Graphs

Edges of an undirected weighted graph: A-B 7, A-D 5, B-C 8, B-D 9, B-E 7, C-E 5, D-E 15, D-F 6, E-F 8, E-G 9, F-G 11. What is the weight of its minimum spanning tree?

  1. A. 37
  2. B. 41
  3. C. 43
  4. D. 39

Correct answer: D. 39

Kruskal accepts A-D 5, C-E 5, D-F 6, A-B 7, B-E 7 and E-G 9 (the rest close cycles): 5 + 5 + 6 + 7 + 7 + 9 = 39.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic