Skip to content
Sign in
Computer

Which of the following data structures is best for creating a priority queue?

Tap an option to check the answer. You can also press A–D.

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.