Which data structure is best for implementing a priority queue?

  • AHash Table
  • BHeap
  • CStack
  • DNone of these
Show answerHide answer

Correct answer B

A heap efficiently supports priority queue operations like insertion and extraction of the highest (or lowest) priority element. Common types include min-heap and max-heap, which maintain the heap property for fast access to priority elements.