A line: values join at the back and leave from the front. Stored in a circular buffer, the front and back are two indices chasing each other around a ring, so neither end ever shifts the elements.
- Typical operation
- O(1)
- Space
- O(n)
A line: values join at the back and leave from the front. Stored in a circular buffer, the front and back are two indices chasing each other around a ring, so neither end ever shifts the elements.