Deque

A deque (a double-ended queue) is a data structure that can behave both like a queue and a stack. It allows data to be pushed to either the front or the back, and data to be popped from either the front or the back of the list. 'Deque' is often pronounced.

This data structure can also be considered identical to a tape loop that can be expanded and contracted. The differences may become significant if the operations on the tape-loop (or deque) are specifically limited in some way.

Operations
There are a few basic Deque operations:

These operations, together with a few (about three max) scalar variables form the additional operations for deques.

Additional Operations
In addition to INJECT, PUSH, POP, and EJECT, there are a few other deque manipulation operations, which include both the stack and queue operations, that deques can use that are generally accomplished through scalar variables.

The following table lists them, including the operation, its name, its traditional (or completely made up) laconic representation, its meaning, and an example in "Generic Deque Language" (GDQL), a language used solely for example purposes.

Esoteric Implementations
Here is the list of esoteric programming languages that use a deque as a central data structure:


 * Category:Deque-based