Which data structure is the best for implementing a priority queue?
Show answerHide answer
Correct answer: (C) Binary heap
Explanation
A binary heap gives O(log n) insertion and removal of the highest-priority item, better than a list or array.
Correct answer: (C) Binary heap
Explanation
A binary heap gives O(log n) insertion and removal of the highest-priority item, better than a list or array.
This is question 112 of BPSC TRE 2.0 (2023) Computer Class 9-10 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.