Deque Data Type#

A Deque is a combination of a Stack and a Queue, providing a homogeneous data type with full access (insertion, peeking, and removal) at both the beginning and the end, but not in the middle.

A deque with access at the beginning and end, but not the middle.