Skip to content

Hash table that grows

storing

Level 2 of 3

Also called Resizing a hash table, Rehashing and Dynamic hash table.

It starts with 2 slots. A number's home is its remainder when divided by how many slots there are, and if that slot is taken it looks at the next. A new number that would fill more than half the slots doubles them first, and every number moves to its new home.

slots looked at
0
numbers moved
0

step 1 of 1

Examples

Numbers from 1 to 99 to put in, up to 8 of them, separated by commas or spaces, for example 17, 10, 24, 25.