From charlesreid1


array-based deque (double-ended queue) object.

implementation details:

  • floating head/tail index variables and dynamic resizing
  • dynamic moving also required - if head floats too far.
  • variable or fixed size.


Link to the code on


The methods implemented for a deque object are:

  • size() - get the number of elements in the queue
  • isEmpty() - returns true if queue is empty
  • first() - return reference to front, but don't remove
  • last() - return reference to back, but don't remove
  • addFront() - add new item to front of queue
  • addBack() - add new item to back of queue
  • removeFront() - remove item from front of queue
  • removeBack() - remove item from back of queue