Comment on Implementations 

There is 3rd common way of implementing deques and that is as an array of pointers to fixed sized pages of the elements (usually a power of 2, even 1 element) The advantage of this scheme is that if new elements are inserted at the front or end of the deque, pages containing elements in the middle of the deque need not be disturbed. Nearly all the C++ vendor implement in this fashion. Note also: The C++ deque cannot be implemented using an array. There is a requirement that references to elements in the middle of a deque remain valid if only the only thing done to the deque is add new elements at either end. An array implementation would fail when the array needs to be reallocated.