Computer Science EngineeringVery hard

The array [4, 10, 3, 5, 1] is converted into a max-heap by the standard bottom-up build-heap procedure. The resulting array is

  1. A. 10 5 3 4 1
  2. B. 10 4 3 5 1
  3. C. 10 5 3 1 4
  4. D. 5 10 3 4 1

Correct answer: A. 10 5 3 4 1

Node 10 is already fine; sifting 4 down swaps it with 10 and then with 5, giving 10 5 3 4 1.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic