Priority Queue

Domain: Data Structures

🎯 Motivation

When some items are more urgent than others, a priority queue serves the highest-priority item first, regardless of arrival order.

📋 Concrete Example

A hospital ER: patients with critical injuries are treated before those with minor cuts, even if the minor-cut patients arrived first.

🔗 Analogy

An airport check-in: business class and families with infants get priority boarding, even if they arrived after economy passengers.