Question 112Asked in BPSC TRE 2.0 (2023) Computer Class 9-10

Which data structure is the best for implementing a priority queue?

  1. ALinked list
  2. BArray
  3. CBinary heap
  4. DMore than one of the above
  5. ENone of the above
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.

From BPSC TRE 2.0 (2023) Computer Class 9-10 — Previous Year Paper

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.