Double Hashing
Each key probes with its own stride, 1 + key mod (size - 1), so keys with the same home follow different paths.
Decision · step 4 of 21Hash Table: Double hashing, a stride per key
Slot 5 is empty, so 5 goes here.
What you will see
Each key hops with its own stride.
Cost
| insert | O(1) expected |
|---|---|
| search | O(1) expected |
| worst case op | O(n) |
| Space | O(capacity) |
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: Each element is an accessibility element with position, value and state; structural changes are announced per step.
Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.
Before this
Related
Taught by the same lesson
Hash Table covers these too, in the same run.