I saw a hash is implemented with load factor of 0.75. What does it mean?
问题:
回答1:
it means that the capacity will be doubled once the collection has enough elements to fit 3/4 of the capacity. Ex: you have a hashmap with size 32. when you put in 24 elements in that hashmap, it will automatically create a new hashmap, of size 64, re-hash the 24 elements and put them in the collection.
The details might depend on the implementation and language, but I think the idea should be clear enough...
回答2:
http://en.wikipedia.org/wiki/Hash_table#Load_factor
回答3:
It means that the hash space (the range of the hash function) has 33% more elements than the hash table is intended to contain. Thus, the table should be no more than 75% full.
回答4:
Load factor refers to how many hash buckets are full. .75 means 75% or 3 in 4. It isn't clear if that means the hash actually was 75% full or if the hash resizes at 75%. You'll need to provide a bit more context.