double-ended queues consider now queue-like data structure that supports insertion and deletion at both the front and the rear of the queue such an extension of queue is called doubleended queueor dequewhich is usually pronounced "deckto avoid confusion with the dequeue method of the regular queue adtwhich is pronounced like the abbreviation " the deque abstract data type the deque abstract data type is richer than both the stack and the queue adts the fundamental methods of the deque adt are as followsaddfirst( )insert new element at the beginning of the deque addlast( )insert new element at the end of the deque removefirst()remove and return the first element of the dequean error occurs if the deque is empty removelast()remove and return the last element of the dequean error occurs if the deque is empty additionallythe deque adt may also include the following support methodsgetfirst()return the first element of the dequean error occurs if the deque is empty getlast()return the last element of the dequean error occurs if the deque is empty size()return the number of elements of the deque isempty()determine if the deque is empty example the following table shows series of operations and their effects on an initially empty deque of integer objects for simplicitywe use integers instead of integer objects as arguments of the operations operation output addfirst(