GATE CS 2011 · Question 54 · Algorithms · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

Statement for Linked Answer Questions 54 and 55:
An undirected graph G(V,E) contains n (n > 2) nodes named v₁, v₂, …, vₙ. Two nodes vᵢ, vⱼ are connected if and only if 0 < |i - j| ≤ 2. Each edge (vᵢ, vⱼ) is assigned a weight i + j. A sample graph with n = 4 is shown below.
What will be the cost of the minimum spanning tree (MST) of such a graph with n nodes?

Undirected weighted graph with 4 nodes V1, V2, V3, V4. V1 is at bottom left, V2 at bottom right of V1, V3 above between V1 and V2, V4 to the right of V3. Edges with weights: V1–V2 weight 3, V1–V3 weight 4, V2–V3 weight 5, V2–V4 weight 6, V3–V4 weight 7.
  1. (A) 1/12(11n² - 5n)
  2. (B) n² - n + 1
  3. (C) 6n - 11
  4. (D) 2n + 1
Answer

Answer (B)

Answer from the official GATE CS 2011 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes