What is a Queue?

A queue is a linear data structure that follows the First In, First Out (FIFO) principle. This means the first element added is the first one to be removed, just like a real-world line or queue.

Visualisation

Have a play around with this.

Head
Tail