The <deque> header file defines the deque class, which is a sequence container such that entries can be added or removed from the front or back efficiently. Unlike built-in arrays, deques grow or shrink to approximately the size of the number of elements in the deque. Additionally, the file defines six relational operators and a swap function that are friend functions of the deque class. In comparison to a vector, a deque is favored when entries must frequently be added and removed from both the front and back to the sequence. An array is favored over a deque for frequent random accesses. As the name suggests, a deque is primarily for creating queues.