0

When the load of the hash table grows too large in proportion to the hash table size, you increase the size of the hash table to improve performance. When the load is too large is dependant on a predetermined value, the load factor.

How do you refer to the term that decides when to decrease the size of the hash table when the load is too small?

if (load > size * 0.75)
 increase_size();
if (load < size * 0.25)
 decrease_size();

Here 0.75 is the load factor of the hash table. What do you call 0.25?

asked Oct 1, 2017 at 17:00
2
  • 2
    I don't think I've ever seen a hash table that automatically shrinks its storage. Out of curiosity, could you link to an example? Commented Oct 1, 2017 at 17:20
  • I agree with @amon. You typically don't shrink hash tables. If they've grown large through use, you'll presumably need the space that the instance provides, even if not immediately. Commented Oct 2, 2017 at 11:55

1 Answer 1

1

You have denoted current load factor with load. The 0.75 is just a threshold for max load factor. Similarly 0.25 is a threshold describing the min load factor we are willing to tolerate.

answered Oct 1, 2017 at 17:10
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.