Descending priority queue can be implemented using ______

Category: QuestionsDescending priority queue can be implemented using ______
Editor">Editor Staff asked 1 month ago

Descending priority queue can be implemented using ______
 
(a) max heap
 
(b) min heap
 
(c) min-max heap
 
(d) trie
 
My question is based upon Heap topic in section Heap of Data Structures & Algorithms I
 
I had been asked this question during an interview for a job.

1 Answers
Editor">Editor Staff answered 1 month ago

The correct choice is (a) max heap
 
Easiest explanation – Descending priority queue arranges the elements based on their priority or value and allows removing the elements in descending order. So, it can be efficiently implemented using max heap.