Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8,…

GATE · 2015 · CS · Set 1 · Computer Science & IT

Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4.

Array Index

1

2

3

4

5

6

7

8

9

Value

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

Attempted by 302 students.

Show answer

Correct answer: B

The worked solution is available to enrolled students.

Video solution available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…