Hash Table Lookup
Hash the key and walk the same path the insert would have walked.
Decision · step 3 of 6Hash Table: Find a key behind a collision
Slot 5 holds 5, not 27. Walk on to slot 6.
What you will see
The same hash lands on the same bucket; the chain or probe path is walked.
Cost
| Best | O(1) |
|---|---|
| Average | O(1) |
| Worst | O(n) |
| Space | O(1) |
How you work with it here
play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.
Screen readers: Buckets announce index, occupancy and keys; each step announces the hash value and where the key lands.
Reduced motion: Keys appear in their bucket with a crossfade instead of travelling from the hash label.
Before this
Taught by the same lesson
Hash Table covers these too, in the same run.