Keyed lookup, collisions, and membership. Work through the operation contract, runnable case, and cost before selecting the structure for a real workload.
Lessons
- Hash maps: keyed lookup with collision and load costs
- Hash sets: fast membership without an order promise
Practice and next steps
- Project: choose structures for a dispatch board
- Project: audit depot connectivity and daily ranges
- Linear and hash structure decisions
- Tree, graph, and range structure decisions
- DSA Tutorial
LRU caches: couple keyed lookup to recency order
Bloom filters: reject absent keys without claiming exact membership
Sparse sets: constant-time membership for bounded integer IDs
Open-addressed hash tables: tombstones and rebuilds
Index snapshots: publish related maps as one in-memory version
Count-min sketches: bounded-memory event estimates
Bitvector rank and select: count and locate set bits
Sorted runs and tombstones: model an LSM read path
Robin Hood hashing: probe distance and backward-shift deletion
Cuckoo hashing: relocate keys and recover from cycles
Inverted indexes: intersect sorted incident postings
Positional postings: find exact token phrases
Trigram indexes: filter and verify substring candidates
Front-coded lexicons: store shared prefixes within sorted term blocks
LFU caches: evict by frequency, then recency
Misra–Gries: find frequent-item candidates in one pass
Space-Saving: ranked candidates with count bounds
HyperLogLog: estimate unique IDs with fixed registers
Counting Bloom filters: delete only a known insertion
Scalable Bloom filters: grow without discarding old members
Blocked Bloom filters: localize probes and watch skew
Cuckoo filters: relocate compact fingerprints safely
Spatial hash grids: move points between occupied cells
Elias–Fano: split sorted IDs into low parts and high bits
Chunked integer sets: switch sparse arrays to dense bitmaps
Gap-encoded postings: add checkpoints to bytewise seeks
Slab slots: reuse fixed-size pages with generation checks
Bitmap hash tries: copy paths for immutable alert maps
Extendible hashing: split buckets through a shared directory
CLOCK caches: revisit pages through reference bits
Segmented LRU: separate probation from protected reuse
Frequency admission: compare an arrival with an eviction victim
Resident LRU-K: Evict by the Kth Recent Reference
Static XOR filters: peel a fingerprint membership index
Linear hashing: split one bucket at a time as a table grows
Two-level perfect hashing: exact static case membership
Block-max postings: skip safe document-score regions
MinHash bands: retrieve incident candidates, then check exact overlap
Run-length bitmaps: union, intersect, and subtract alert spans
Count Sketch: estimate signed incident frequencies with row medians
Hopscotch hashing: keep each shipment near its home bucket
Invertible Bloom tables: peel differences between replica ID sets
SimHash bands: find near-duplicate incident fingerprints
All-one frequency buckets: increment, decrement, and read both extremes
