Deque

from Wikipedia, the free encyclopedia

A deque ( D ouble- e nded que ue , ie: "deck") refers to a data structure of computer science .

This is a data structure similar to the queue or the stack . The difference is that the data can be read, inserted, or removed at either end.

The Deque's operations are:

  • PUSH and POP for inserting or removing an element at the rear end of the deque.
  • PUT and GET for inserting or removing at the front end of the deque.
  • FIRST and LAST for reading the first or last element without removing it.

Technically, the deque is implemented either as a doubly linked list - similar to the queue or the stack memory - or as a field with auxiliary indices.

In practice, the Deque is used, among other things, to implement non-deterministic finite automata and to search for text using regular expressions ( pattern matching algorithm).

Trivia

In the esoteric programming language "AlPhAbEt", a deque (known there as "Queack") is the only data structure available.

Web links