Load factor and rehashing in hashsets

  • Thread starter Thread starter ndesk1900
  • Start date Start date
  • Tags Tags
    Load
AI Thread Summary
The discussion centers on key aspects of hashing, particularly regarding load factors in hash tables. A load factor below 100% can help maintain performance by reducing the likelihood of collisions, whereas a load factor at 100% may lead to increased collisions and slower access times. Increasing the capacity of a hash table typically requires rehashing all existing values, which can be a significant overhead. The conversation also highlights that initializing a large hash table can be time-consuming, especially if aiming for a low load factor. There is a mention of the need for optimization strategies for dynamic capacity management, as performance can degrade when the load factor exceeds two-thirds.
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]
 
Technology 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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top