Medium

Priority Queue

A priority queue returns the smallest or largest item next, not the oldest. A binary heap is the usual implementation.

Costs

CategoryData Structure
DifficultyMedium
Peek at the extremeO(1)
InsertO(log n)
Remove the extremeO(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.