GATE CS 2015 · Set-1 · Arrays & Matrix Representation

MCQ · 2 marks · Problem PROG-DSTR-0140

Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4. Now consider that a value 35 is inserted into this heap. After insertion, the new heap is
  1. A
    40, 30, 20, 10, 15, 16, 17, 8, 4, 35
  2. B
    40, 35, 20, 10, 30, 16, 17, 8, 4, 15
  3. C
    40, 30, 20, 10, 35, 16, 17, 8, 4, 15
  4. D
    40, 35, 20, 10, 15, 16, 17, 8, 4, 30

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/8273/gate2015-1-27

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com