June 2019
Beginner to intermediate
770 pages
19h 24m
English
A list object is designed to provide uniform performance for any element within the container. Some operations have performance penalties. Most notably, any operation extending from the front of a list, such as list.insert(0, item), or removing from the front of a list, such as list.pop(0), will incur some overheads because the list's size is changed, and the position of each element must then changed.
A deque – a double-ended queue – is designed to provide uniform performance for the first and last elements of a list. The idea is that appending and popping will be faster than the built-in list object.
Our design for a deck of ...
Read now
Unlock full access