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

OperationTime Complexity
EnqueueO(1)
DequeueO(1)
PeekO(1)
Priority Queue — InsertO(log n)
Priority Queue — Extract-minO(log n)

data-structures linear queues