Double ended queue
deque (usually pronounced like "deck") is an irregular acronym of double-ended queue. Double-ended queues are sequence containers with dynamic sizes that can be expanded or contracted on both ends (either its front or its back).
Use
For operations that involve frequent insertion or removals of elements at positions other than the beginning or the end, deques perform worse and have less consistent iterators and references than lists and forward lists.
Method Modified
- push_back
- Add element at the end (public member function )
- push_front
- Insert element at beginning (public member function )
- pop_back
- Delete last element (public member function )
- pop_front
- Delete first element (public member function )