Heap can be used as ________________

Category: QuestionsHeap can be used as ________________
Editor">Editor Staff asked 1 month ago

Heap can be used as ________________
(a) Priority queue
(b) Stack
(c) A decreasing order array
(d) Normal Array
The question is from Heap in section Heap of Data Structures & Algorithms I
This question was addressed to me in final exam.

1 Answers
Editor">Editor Staff answered 1 month ago

Correct choice is (a) Priority queue
For explanation: The property of heap that the value of root must be either greater or less than both of its children makes it work like a priority queue.