Which data structure is commonly used to implement a priority queue efficiently?
Correct answer C. Binary heap
A binary heap supports insert and remove-max (or remove-min) in O(log n) time and peek in O(1), which makes it the standard priority queue implementation; Python's heapq and C++ std::priority_queue both use one. An unsorted linked list gives O(1) insert but O(n) removal, and a sorted one reverses that trade-off, so neither is efficient for both operations.
Answer checked How we write and check questions
Discussion