maximum length of the queue.
pushing more items than the length will remove the items from the opposite side, so as to maintain the size
iterate over the items in this deque, starting from the rear-most item, and ending at the front-most item
inserts one or more items to the back of the deque.
if the deque is full, it will remove the front item before adding a new item
Rest
...items: T[]inserts one or more items to the front of the deque.
if the deque is full, it will remove the rear item before adding a new item
Rest
...items: T[]replaces the item at the specified index with a new item.
inserts an item at the specified index, shifting all items ahead of it one position to the front.
if the deque is full, it removes the front item before adding the new item.
a double-ended circular queue, similar to python's
collection.deque