<P> In computer science, a double - ended queue (dequeue, often abbreviated to deque) is an abstract data type that generalizes a queue, for which elements can be added to or removed from either the front (head) or back (tail). It is also often called a head - tail linked list, though properly this refers to a specific data structure implementation of a deque (see below). </P> <P> Deque is sometimes written dequeue, but this use is generally deprecated in technical literature or technical writing because dequeue is also a verb meaning "to remove from a queue". Nevertheless, several libraries and some writers, such as Aho, Hopcroft, and Ullman in their textbook Data Structures and Algorithms, spell it dequeue . John Mitchell, author of Concepts in Programming Languages, also uses this terminology . </P> <P> This differs from the queue abstract data type or First - In - First - Out List (FIFO), where elements can only be added to one end and removed from the other . This general data class has some possible sub-types: </P> <Ul> <Li> An input - restricted deque is one where deletion can be made from both ends, but insertion can be made at one end only . </Li> <Li> An output - restricted deque is one where insertion can be made at both ends, but deletion can be made from one end only . </Li> </Ul>

Difference between input restricted deque and output restricted deque