/    /  Data Structures-Deque

Deque

 

Deque stands for Double Ended Queue. The insertion occurs at the rear end and the deletion occurs at the front end, and deque is a linear data structure in which deletion and insertion occur at both ends. 

It can be used as a stack and queue both.

There are two types of queue:

  1. Input-restricted queue
  2. Output-restricted queue

 

Operations of deque

The following operations of deque are as follows:

  1. Insert at front
  2. Insert at rear
  3. Delete from front
  4. Delete from rear 
  5. isFull()
  6. isEmpty()

 

Applications of deque

  1. It can perform both redo and undo operations.
  2. It is also used for multiprocessor scheduling.
  3. It can be used as a palindrome checker. 

 

Example of a program of the deque

 

 

Reference
Deque