Modules in Python: deque
Let's discover deque and its functions.
We'll cover the following...
About deque
According to the Python documentation, “deques are a generalization of stacks and queues”.
They are pronounced “deck” which is short for
“double-ended queue”. They are a replacement container for the Python
list. Deques are thread-safe and support memory efficient appends and
pops from either side of the deque. A list is optimized for fast
fixed-length operations. A deque accepts a maxlen argument which sets the
bounds for the deque. ...
Ask