Priority Queue
A priority queue returns the smallest or largest item next, not the oldest. A binary heap is the usual implementation.
Costs
| Category | Data Structure |
| Difficulty | Medium |
| Peek at the extreme | O(1) |
| Insert | O(log n) |
| Remove the extreme | O(log n) |
Questions
What is Priority Queue?
A priority queue returns the smallest or largest item next, not the oldest. A binary heap is the usual implementation.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.