Basis Lab

Finding It Instantly

When Two Keys Collide

Last timeTurning a Key Into an Address

Two keys land on the same position, which is certain to happen. There are exactly two serious answers: hang a list off the slot, or go looking for another slot, and they fail differently.

Two keys arrive at the same position. The last lesson proved this must

happen; this one is about what to do at that moment.

There are two serious answers, and the choice between them is the main design

decision in any hash table.

The lesson stops here

1 more paragraph to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01Finding One Thing Among Many
  2. 02Turning a Key Into an Addressopening only
  3. 03When Two Keys Collideyou are here
  4. 04How Full Is Too Fullopening only
  5. 05What Makes a Hash Function Goodopening only
  6. 06Asking Only Whether It Is Thereopening only
  7. 07What a Hash Table Cannot Doopening only
  8. 08The Same Trick Everywhere Elseopening only

Read alongside