Binary Heaps questions

Q30

GATE CS 2015 CS-3Tree Data StructuresMCQ1 mark−1/3 if wrong
Consider the following array of elements.

(89,19,50,17,12,15,2,5,7,11,6,9,100)(89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100)

The minimum number of interchanges needed to convert it into a max-heap is
Show answer without attempting

Answer: D

Q37

GATE CS 2015 CS-1Tree Data StructuresMCQ2 marks−2/3 if wrong
Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4.
Array Index123456789
Value4030201015161784
Now consider that a value 35 is inserted into this heap. After insertion, the new heap is
Show answer without attempting

Answer: B

Q22

GATE CS 2015 CS-2Tree Data StructuresMCQ1 mark−1/3 if wrong
Consider a complete binary tree where the left and the right subtrees of the root are max-heaps. The lower bound for the number of operations to convert the tree to a heap is
Show answer without attempting

Answer: A

0/30 correct0 marks

Related topics in Tree Data Structures