... stack adapter because a
deque grows more efficiently than a
vector is maintained as a contiguous block of memory—when that block is full and a new element is added, the
vector allocates a larger contiguous block of memory and copies the old elements into that new block. A
deque, on the other hand, is typically implemented as a list of fixed-size, built-in arrays—new fixed-size built-in arrays are added as necessary and none of the existing elements are copied when new items are added to the front or back. For these reasons, we use a
deque (line 36) as the underlying container for our
The member-function definitions of a class template are function templates, but are not preceded ...