Which data structure is best for implementing a priority queue?
Show 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.