Stage 1 · Code
Stacks & Queues
Queue
FIFO operations, circular queue, and Go's channel-based queues.
Queue Concept
A queue is a FIFO (First In, First Out) data structure. Like a line of people — first person in line gets served first. Operations: enqueue (add to rear), dequeue (remove from front), peek (view front).
Implementations
Circular Queue
Fixed-size array with head/tail indices that wrap around. Avoids shifting. Used when max size is known and fixed.
Go Channels as Queues
Go's channels are thread-safe queues. Buffered channels act as bounded queues. Unblocked on send/receive for concurrency patterns.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.