

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 10
click for more info
Not enough gems
Cost: 6 gems
1: Hashmaps
incomplete
2: Hash Function
incomplete
3: Insert
incomplete
4: Get
incomplete
5: Hash Map Review
incomplete
6: Resizing
incomplete
7: Linear Probing
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Our current hashmap has a lot of collisions because we're using a fixed-size underlying list.
To reduce the chances of a collision, we can increase the number of slots in our hashmap. This is called resizing. This will not eliminate all possible collisions, but it will help reduce the chance of one happening.
When resizing, we create a new hashmap with more slots. Then, we re-insert all the key-value pairs from the old hashmap into the new hashmap.