← Hashing · guided lesson

Hashing & Prefix Sums

1 / 19 · story

the story

Hash table

Every tool here exists because something was too slow or broke without it. Here is what.

1953 · Hans Peter Luhn; Gene Amdahl, Elaine M. McGraw (née Boehme), Nathaniel Rochester, Arthur Samuel (IBM); Arnold Dumey; W. Wesley Peterson

In January 1953 Hans Peter Luhn wrote an internal IBM memo that put keys into numbered buckets and chained the overflow — one of the first uses of linked lists. At about the same time, Gene Amdahl, Elaine McGraw (née Boehme), Nathaniel Rochester and Arthur Samuel used hashing in an assembler for the IBM 701; Amdahl is credited with open addressing with linear probing. Arnold Dumey gave the first published description in 1956, and W. Wesley Peterson's 1957 paper studied open addressing in depth. Knuth's The Art of Computer Programming, Vol. 3 (§6.4), tells the full story.

the problem it solved

Finding a record by its key in about one step, instead of scanning everything or keeping the data sorted.

why it matters: without it

Every "have I seen this?" or "what's stored under this key?" would cost O(n), or O(log n) with sorted structures — caches, compilers and deduplication would all slow down by orders of magnitude.

sources: IEEE Spectrum — Hans Peter Luhn and the Birth of the Hashing Algorithm (2018) ↗ · Peterson — Addressing for Random-Access Storage (IBM J. Res. Dev., 1957) ↗ · Knuth — The Art of Computer Programming, Vol. 3, §6.4 Hashing (history) ↗ · Wikipedia — Hash table: History (Luhn's memo, the IBM 701 assembler, Dumey, Peterson) ↗ · Pro Git — Git Internals: Git Objects (objects stored by hash under .git/objects) ↗

also in this chapter: Java's HashMap (resize + treeify) · Prefix sums (1D) · 2D prefix sums (summed-area table) · Prefix sum + HashMap