Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

ISRO | ISRO CS 2018 | Question 55

  • Last Updated : 01 Jun, 2021

Given a binary-max heap. The elements are stored in an arrays as 25, 14, 16, 13, 10, 8, 12. What is the content of the array after two delete operations?
(A) 14,13,8,12,10
(B) 14,12,13,10,8
(C) 14,13,12,8,10
(D) 14,13,12,10,8


Answer: (C)

Explanation:

After the first deletion:      12, 14, 16, 13, 10, 8 -> heapify -> 16, 14, 12, 13, 10, 8 
After the second deletion: 8, 14, 12, 13, 10 -> heapify-> 14, 8, 12, 13, 10 -> heapify -> 14, 13, 12, 8,10

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!