Deque is a data structure, called as doubly ended queue. It provides us push_back
, push_front
, pop_back
and pop_front
operations in O(1) time complexity and hence it is quite useful in many usecases.
Dequeue stands for “Double ended queue “.
Unlike Queue data structure ( where we add element from only one end and delete element from other end ) , In Dequeue we can add and delete element from both the ends .
That is we can add element from front end as well as back end…and also delete element from front end as well as back end.