wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

A priority queue is implemented as a max-heap initially, it has five elements. The level-order traversal of the heap is as follows:
20, 18, 15, 13, 12
Two new elements '10' and '17' are inserted in the heap in that order, The level-order traversal of the heap after the insertion of the element is

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

The correct option is B 20, 18, 17, 13, 12, 10, 15

flag
Suggest Corrections
thumbs-up
2
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Sets and Their Representations-1
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon