As a rule, you have a hash table containing N elements distributed in an array of M slots.
There is a percentage value (called "growthFactor") defined by the user when creating the hash table, which is used this way:
if (growthRatio < (N/M)) Rehash();
rehash means that your array of M slots needs to be resized to contain more elements (a prime larger than the current size (or 2x more) is ideal) and that your elements should be distributed in a new larger array.
This value should have a value from 0.6 to 0.8.
ebasconp
source share