A double-ended queue: push and pop at both the front and the back. In a circular buffer, head steps backwards for a front push and tail steps forwards for a back push, wrapping around the ring as needed.
- Typical operation
- O(1)
- Space
- O(n)
A double-ended queue: push and pop at both the front and the back. In a circular buffer, head steps backwards for a front push and tail steps forwards for a back push, wrapping around the ring as needed.