I saw a hash is implemented with load factor of 0.75. What does it mean?
相关问题
- facebook error invalid key hash for some devices
- Finding k smallest elements in a min heap - worst-
- binary search tree path list
- Change sort order of strings includes with a speci
- High cost encryption but less cost decryption
相关文章
- What are the problems associated to Best First Sea
- Coin change DP solution to keep track of coins
- Bcrypt vs Hash in laravel
- Algorithm for partially filling a polygonal mesh
- Robust polygon normal calculation
- Algorithm for maximizing coverage of rectangular a
- Does a sorted queue exist in .NET?
- Understanding the difference between Collection.is
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.
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...
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.
http://en.wikipedia.org/wiki/Hash_table#Load_factor