Computer
Which of the following data structures is best for creating a priority queue?
Show answer
Correct answer: C) Binary Heap
A priority queue processes elements based on priority, not arrival order.
A heap allows efficient insertion and removal of the highest (or lowest) priority element.
Min-Heap gives quick access to the smallest element, Max-Heap to the largest.
Explanation
A priority queue processes elements based on priority, not arrival order.
A heap allows efficient insertion and removal of the highest (or lowest) priority element.
Min-Heap gives quick access to the smallest element, Max-Heap to the largest.