Queues
← Back to Linear Structures
First-In-First-Out (FIFO) collection. Elements are enqueued at the back and dequeued from the front. Foundation for BFS, task scheduling, and buffering.
Key Properties
Complexity
| Operation | Time Complexity |
|---|---|
| Enqueue | O(1) |
| Dequeue | O(1) |
| Peek | O(1) |
| Priority Queue — Insert | O(log n) |
| Priority Queue — Extract-min | O(log n) |
Related
- Stacks (contrast — LIFO)
- Heaps (priority queue implementation)
- BFS Applications