Playground

Queue Simulator

A First-In-First-Out (FIFO) data structure. See how elements enqueue at the back and dequeue from the front.

Queue Structure

A FIFO (First-In-First-Out) data structure. Here we demonstrate an Abstract conceptual view, and two true O(1) implementations: a dynamic Linked List with nodes and pointers, and a Circular Array using modulo arithmetic for the pointers.

Capacity

ENQUEUE

Step 1: Receive enqueue request with new item
Step 2: Check if the Pipe (Queue) has reached capacity
-> Alert: Cannot add to a full pipe (Overflow!)
Step 3: Proceed to add item since pipe has space
Step 4: Push the new item into the back (REAR)
Step 5: Increase the tracked size by 1
Step 6: Operation finished successfully

Console Output

SIZE: 0 / 6
>Waiting for operations...