GATE CS 2015, set 3 · Question 30 · Programming and Data Structures · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Consider the following array of elements.
⟨ 89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100 ⟩
The minimum number of interchanges needed to convert it into a max-heap is

  1. (A) 4
  2. (B) 5
  3. (C) 2
  4. (D) 3
Answer

Answer (D)

Answer from the official GATE CS 2015 answer key.

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