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

A heap allows a very efficient implementation of a -

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

The correct option is A Priority queue

A heap allows a very efficient implementation of a Priority queue.

Priority queue can be implemented using an array, a list, a binary search tree or a heap, although the most efficient one being the heap.

A heap is a specialized tree-based data structure that satisfies the heap property: if p is a parent node of C, then the key (the value) of P is either greater than or equal to (in a max heap) or less than or equal to (in a min heap) the key of C. The node at the "top" of the heap (with no parents) is called the root node.



915153_917374_ans_e9e4823b25444c5998a655cc804885fb.PNG

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Administration Reforms
CIVICS
Watch in App
Join BYJU'S Learning Program
CrossIcon