Heap can be used as ________________

Category: QuestionsHeap can be used as ________________
Editor">Editor Staff asked 4 weeks 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 4 weeks 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.