|
|
|
||
|
From the constructor of
// Find a power of 2 >= initialCapacity
int capacity = 1;
while (capacity < initialCapacity)
capacity <<= 1;
this.loadFactor = loadFactor;
threshold = (int)(capacity * loadFactor);
table = new Entry[capacity];
where
loadFactor = 0.75;
If So what does this all mean? Given a distribution of hash values that fills each bucket only once (such as adding integers) and the default load factor of It should also be noted that chaining is dominant for small non-power-of-two initial capacities (again, given the default load factor). Something to keep in mind. HashMap hash function problems in 1.4.0 |
| Post a comment |
|
|
Unless otherwise expressly stated, all original material of whatever nature created by Rob Grzywinski and included in this weblog and any related pages, including the weblog's archives, is licensed under a Creative Commons License. |