dequeue

Generalization of the queue ADTs that supports insertion and deletion from both ends.

Operations

  • PUSH-BACK(Q,x): insert element x at the end of queue Q (same as ENQUEUE)
  • PUSH-FRONT(Q,x): insert element x at the front of queue Q (also called UNSHIFT)
  • POP-BACK(Q): remove and return the element at the end of queue Q
  • POP-FRONT(Q): remove and return the element at the front of queue Q (SHIFT)