Quadratic Probing
Probe i jumps i^2 slots from the home slot, so a run of taken slots is left behind instead of growing.
Decision · step 4 of 24Hash Table: Quadratic probing leaves the cluster
Slot 5 is empty, so 5 goes here.
What you will see
Hops grow (1, 4, 9, ...), spreading keys away from clusters.
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.