Priority Queue Visualization

Elements are served based on their priority, not their arrival time (Higher number = Higher priority)

Priority Color Legend

Critical (9-10)
High (7-8)
Medium (5-6)
Low (3-4)
Minimal (1-2)

Priority Queue Structure

Priority Queue is empty. Add elements with their priorities!

Queue Properties

Size: 0
Front: null
Is Empty: Yes
Order: By Priority

Time Complexities

Enqueue: O(n)
Dequeue: O(1)
Peek: O(1)
Space: O(n)

Real-world Applications

🚨 Emergency Room

Treating patients by urgency

⚙️ CPU Scheduling

Process scheduling by priority

📧 Email Systems

Important emails first

🔍 Dijkstra's Algorithm

Shortest path finding