This unit has derived the cost guarantees of heaps, hash tables, and balanced search trees from first principles — the point of this closing lesson is to map those guarantees directly onto what a quant researcher actually types:
heapq, bisect, dict, and set. Per this unit's "quant-practice-track" framing, most day-to-day work leans on these standard-library structures rather than hand-rolled red-black or B-trees, and knowing exactly which cost table each one inherits — and where the standard library has no built-in equivalent (an augmented balanced tree, notably) — is what turns the preceding lessons into usable engineering judgement rather than trivia.In this lesson
- Learning objectives
heapq: a min-heap, directlybisect: binary search on a sorted list, not a balanced treedictandset: hash tables, with the same caveats- The one genuine gap: augmented ordered structures
Before you start
- Augmenting Data Structures: Order-Statistics Trees and Interval Trees
- Hash Tables: Chaining, Open Addressing, and Universal Hashing
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or explore the curriculum.