Hash tables from scratch: hashing, collisions, load factor
11 steps · about 6 h 35 min · Intermediate
- Hash Tables - CS50 Shorts (video, CS50 (Harvard), 10 min)
A short, clear first look at keys, buckets and hash functions before any code.
- Hash Tables Explained: How Dictionaries Really Work (article, Priodemy, 10 min)
Sums up the whole idea in plain language: hash function, collisions, resizing and why O(1) is only an average.
- Open Hashing (separate chaining) visualization (interactive, David Galles, USFCA, 15 min)
Insert keys yourself and watch chains grow when keys collide.
- Closed Hashing (open addressing) visualization (interactive, David Galles, USFCA, 15 min)
Compare how linear probing and double hashing handle the same collisions you just saw as chains.
- CS50x 2025 - Lecture 5 - Data Structures (video, CS50 (Harvard), 1 h 30 min)
A full lecture that builds hash tables out of arrays and linked lists, with the hash table section in context.
- Hash Tables 101: Collisions, Resizing, Hashing (article, DEV Community, 10 min)
Introduces load factor and the usual 0.6–0.75 range, plus resizing, before you start coding.
- Free Hash Table Visualizer (interactive, Simulations4All, 20 min)
Lets you compare hash functions, watch clustering form and see tombstones and rehashing at different load factors.
- How HashMap Works: Hash Functions, Collisions, Load Factor (article, Algorithms Crash Course, 15 min)
Explains why chaining and probing tables differ in how far the load factor can go, and how rehashing works.
- Build a Hash Table in Python With TDD (tutorial, Real Python, 2 h)
Build a complete hash table step by step with tests, including resizing at a load factor threshold.
- Hash Tables · Crafting Interpreters (doc, Robert Nystrom, 1 h)
Shows a production-style open-addressing table in C, with load-factor tuning and tombstones.
- Hash table (reference, Wikipedia, 30 min)
A reference to check your understanding against, covering load factor, chaining versus open addressing, and performance.