Hash Function
Turns a key into a slot number. Here it is key mod capacity, weak on purpose so collisions show.
Decision · step 4 of 32Hash Table: Fill a table and watch it collide
Slot 1 is empty, so 12 goes here.
What you will see
The same key always lands in the same bucket; similar keys land far apart.
Cost
| hash | O(key length) |
|---|---|
| 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: 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.