Load factor and rehashing in hashsets

  • Thread starter Thread starter ndesk1900
  • Start date Start date
  • Tags Tags
    Load
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
ndesk1900
Messages
4
Reaction score
0
I had some general questions related to hashing.

1. Load factor in a HashTable is when you want to increase capacity of buffer. Is there any advantage/disadvantage of setting the loadfactor less than 100% vs setting load factor at 100%?

2. When you increase capacity, you have to rehash all values inside. Is there any way to increase capacity without a rehash?

This is crossposted on [http://stackoverflow.com/questions/13120021/load-factor-and-rehashing-in-hashsets]
 
Physics news on Phys.org
Wiki article mentions overhead increases once the load factor exceeds about 2/3rds.

http://en.wikipedia.org/wiki/Hash_table#Load_factor

Not mentioned is the time it takes to iniitialize a hash table to empty, which could be an issue with a huge hash table in an attempt to produce a very low load factor (or one with a huge capacity). I don't know how to optimize dynamic capacity.