Explore detailed execution
Every row is a meaningful action from this stored run. Select one to inspect its saved state and optional Java reference.
Return to the interactive table and try a different key.
Expected constant time with a well-distributed hash.
O(n + m)Linked nodes share a bucket when their hashes collide.
Choose a scenario to follow the structure.
A hash function chooses a bucket. Separate chaining stores every key assigned to that bucket in a linked chain. To insert, look up, or remove a key, compare the complete key at each node.
Worked example. Java hashes "11" to 1568 and "98" to 1823. Both have remainder 3 modulo 5. Inserting 98 → dog beside 11 → cat creates two distinct nodes in bucket 3.
Which bucket will this key use?
The explanation follows the selected Java line and live table state.
Linked nodes share a bucket when their hashes collide.
Insert, look up, remove, or rehash string keys while preserving the map: each distinct key has exactly one value.
Press Play to see what happens.
Scroll to follow how your operation changes the table.
Every row is a meaningful action from this stored run. Select one to inspect its saved state and optional Java reference.
Return to the interactive table and try a different key.