# TAOCP 6.4 Hashing (part 2)

> Study guide to TAOCP 6.4 Hashing (part 2). Part 2 covers the rest of the section (pages 533 to 549): deleting from open-addressed tables without breaking…

Updated October 20, 2026.

## Summary {#summary}

TAOCP 6.4 Hashing (part 2) covers the rest of the section (pages 533 to 549): deleting from open-addressed tables without breaking later searches, the starred analysis of expected probe counts for chaining, and more. Budget about 9 hours; do exercises 21, 65 and 42.

Part 2 covers the rest of the section (pages 533 to 549): deleting from open-addressed tables without breaking later searches, the starred analysis of expected probe counts for chaining, linear probing and double hashing as the table fills, hashing on external storage with buckets, a comparison of all the methods, and history.

## Key facts {#key-facts}

- Week 115 of 145 on the cracked.guide path, in [TAOCP Vol 3: Sorting and Searching](https://cracked.guide/taocp/volume-3).
- Time budget: about 9 hours.
- 78 exercises in the section, rated 10 to M49; the guide picks 8.
- Picked exercises with Knuth's triangle for recommended: 21, 65, 42, 33, 34, 23 and 37.
- Before you start: 6.4 Hashing (part 1).

## Week 115 goals {#objectives}

By the end of week 115 you can:

- Explain why clearing a slot breaks later searches under open addressing.
- Compute expected probe counts for linear probing at several load factors.
- Compare chaining, linear probing and double hashing as the table fills.

## This week's steps {#steps}

- Read §6.4 Hashing (part 2): Compare this with your clox hash table from chapter 20: tombstones, load factor, linear probing.
- Work the exercises (8 picked): Start with Ex 21, Ex 65, Ex 42; log what you solve below.
- Write down one thing you'd explain to someone: A few sentences in your own words in Your notes: the idea, why it works, an example. 30 words ticks this.

## Exercises {#exercises}

Section 6.4 has 78 exercises (one set for both weeks), rated 10 to M49, and Knuth marks 15 of them with the triangle for recommended. This week covers pages 533 to 549: deletions, the analysis of the algorithms, external searching, the comparison of methods and the history. The matching exercises are 21 to 65 and 67 to 71 (50 exercises, 8 recommended: 21, 23, 33, 34, 37, 42, 48, 65). Most are M or HM analysis; pick a few rather than grinding through. 57, 60 and 62 are open, and many in the 40s are research-level.

Worth your time:

- 21 (rated 20, recommended): After marking a record deleted, should the item count go down?
- 65 (rated 20, recommended): How to store variable-length keys in a hash table.
- 42 (rated M20, recommended): Probability that chained hashing finds a free slot immediately.
- 29 (rated M21): The parking problem: linear probing told as a story about cars.
- 33 (rated M23, recommended): Why the classic linear probing estimate is only an approximation.
- 34 (rated M23, recommended): List-length distribution and probe counts for separate chaining.
- 23 (rated 33, recommended): Design deletion for coalesced chaining, analogous to linear-probing deletion.
- 37 (rated M29, recommended): Variance of successful search cost under separate chaining. The stretch.

## Why it matters {#why}

Open addressing with linear probing is what many modern high-performance hash tables use. Knuth's linear probing analysis is historically the start of the field of algorithm analysis.

## Before you start {#before}

- 6.4 Hashing (part 1)

## How to approach it {#approach}

Compare this with your clox hash table from chapter 20: tombstones, load factor, linear probing. Measure probe counts at load factors 0.5, 0.75 and 0.9 and compare to Knuth's formulas.

## Common traps {#traps}

- Deleting by just clearing a slot breaks later searches. Tombstones or Knuth's deletion algorithm fix this.
- Letting the load factor get close to 1 with linear probing.

## Links {#links}

- [Knuth's TAOCP page (editions, errata, MIX/MMIX)](https://www-cs-faculty.stanford.edu/~knuth/taocp.html)
- [Vol 3 errata (plain text, from Knuth)](https://www-cs-faculty.stanford.edu/~knuth/err3.textxt)
- [Wikipedia: Open addressing](https://en.wikipedia.org/wiki/Open_addressing)
- [Wikipedia: Linear probing](https://en.wikipedia.org/wiki/Linear_probing)
- [Wikipedia: Double hashing](https://en.wikipedia.org/wiki/Double_hashing)
- [Hacker News: Hash tables with open addressing](https://news.ycombinator.com/item?id=13270556)

---

Source: https://cracked.guide/guide/knuth-w098-0
cracked.guide: A free, dated 145-week path to getting genuinely cracked at programming.
