CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the binary min heap given below:(min heap is a binary tree where each node in a tree has a key which is less than or equal to the key of its children)Insert the key 1 in above min heap which of the following is the resulantmin heap after two delete operations?

A
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution

The correct option is D
When we insert 1 in the heap

For deleting 1.1 is exchanged with last element of min heap.

Now we have to maintain the min heap property. After balancing the min heap it become





This is the resultant heap so correct answer is option (a).

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Empty Set
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon