Hash Set
A hash table holding keys only, to answer whether something is present.
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
Duplicate insert lands on an existing key and bounces off.
Cost
| add | O(1) expected |
|---|---|
| contains | O(1) expected |
| remove | O(1) expected |
| Space | O(n) |
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
Leads to
Topics that need this one first.
Taught by the same lesson
Hash Table covers these too, in the same run.