Python's other collection types and algorithms
summary
Explains concrete Python tradeoffs and shows code: lists use geometric growth for amortized O(1) append; collections.deque gives O(1) pops left and is ~750× faster on large queues and ~25× faster even for small push/pops; use bisect for binary search (beats linear after ~46 items); use heapq or heapq.nlargest to keep top-k without sorting everything; defaultdict/Counter simplify counting and grouping; namedtuple and OrderedDict provide readable tuples and insertion-ordered mappings; builds working examples (BFS/DFS queues, sliding-window history, inverted letter→words index).
AI-written summary · about
chapters (7)
- 0:00Start
- 0:36Lists
- 19:07Binary Search
- 35:47Sets
- 38:54Set Operations
- 42:10Dictionaries
- 48:50Ordered Missionary








