A queue needs two access points, one end to add and another to remove. You back it with either a linked list holding head and tail pointers, or a ring buffer over a fixed array.
With a linked list, you enqueue at the tail and dequeue at the head, both O(1). The tail pointer is what keeps enqueue cheap. Without it, you would walk the whole list.
A ring buffer uses two indices that chase each other and wrap around the array. That gives O(1) operations with far better cache behavior and no per-node allocation. The catch is fixed capacity, so you either grow the array or reject when full.
Pick the ring buffer when throughput matters, like network packet handling, and the linked list when the queue must grow without bound.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
The diagram below the answer is the concept . Jump to it ↓