Computer Science EngineeringVery hardISRO SC (CS)

The max-heap [92, 49, 62, 39, 40, 19, 28, 36, 38] undergoes one extract-max (last element moved to the root, then sifted down). The resulting heap array is:

  1. A. [49, 62, 39, 40, 19, 28, 36, 38]
  2. B. [62, 49, 38, 39, 40, 19, 28, 36]
  3. C. [62, 49, 40, 39, 38, 36, 28, 19]
  4. D. [38, 49, 62, 39, 40, 19, 28, 36]

Correct answer: B. [62, 49, 38, 39, 40, 19, 28, 36]

Remove 92, place 38 at the root and sift down: [62, 49, 38, 39, 40, 19, 28, 36].

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

Exams that ask this topic