Computer Science EngineeringHardISRO SC (CS)

The max-heap [95, 84, 54, 64, 16, 43, 42, 24] undergoes one extract-max (last element moved to the root, then sifted down). The resulting heap array is:

  1. A. [84, 64, 54, 24, 16, 43, 42]
  2. B. [84, 54, 64, 16, 43, 42, 24]
  3. C. [84, 64, 54, 43, 42, 24, 16]
  4. D. [24, 84, 54, 64, 16, 43, 42]

Correct answer: A. [84, 64, 54, 24, 16, 43, 42]

Remove 95, place 24 at the root and sift down: [84, 64, 54, 24, 16, 43, 42].

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

Exams that ask this topic