While Putting items.
1. Calculate hashcode of key
2. If basket with that hashcode is present then use the equals method on the key search the keys i that basket to determine if the element is to be added or replace.
3. If not there then create new basket (rehashing) and add that element to that.
Get:
1. Get the hashcode of key
2. Go to that basket
3. Iterate using equals on the key will return you that element from that basket.
Note:
1. Calculate hashcode of key
2. If basket with that hashcode is present then use the equals method on the key search the keys i that basket to determine if the element is to be added or replace.
3. If not there then create new basket (rehashing) and add that element to that.
Get:
1. Get the hashcode of key
2. Go to that basket
3. Iterate using equals on the key will return you that element from that basket.
Note:
- If a map load becomes higher than the load factor (default 75%), the map size will be increased and the map will be rehashed. this is an expensive operation so if you know your map size in advance it’s best to tune the size and the load factor to values which will not trigger a rehash.