Week 115 of 145 · TAOCP Vol 3: Sorting and Searching

TAOCP 6.4 Hashing (part 2)

1 task, 3 steps. Open a task's steps to see exactly what to do; each guide has the detail.

Sign up or sign in to tick these off and give this week a due date.

By the end of this week 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.

Week 115 · Self-check

Three quick questions

Ungraded, and it never holds anything up. Pick an answer to see why.

  1. Linear probing put 10 in slot 3, 17 in slot 4 and 24 in slot 5 (all hash to 3). You delete 17 by emptying slot 4. What happens when you search for 24?
  2. Knuth's estimate for an unsuccessful search with linear probing is ½(1 + 1/(1 − α)²). About how many probes is that at α = 0.9?
  3. Which collision method keeps working when there are more keys than table slots?

Nothing is saved while signed out.

Watch along

Free talks and lectures that go with this week, on the speakers' own channels. Optional.

Discussion

0 posts

Stuck on week 115, or finished early? Say what you tried and what happened. Hints over answers: full solutions go in a spoiler.

No posts yet. Ask a question or share a tip.

Sign in to postAnyone can read. Posting needs an account with a confirmed email.

Spot a mistake? Report it