This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes HashMap - load factor ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "HashMap - load factor ?" Watch "HashMap - load factor ?" New topic
Author

HashMap - load factor ?

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1303
HashMap's initial capacity assigns number of buckets. Whether load factor is number of elements in each bucket (or) HashMap expansion range?
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1303
Any update ?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3065
    
    1

What did the documentation say?
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1303
Document did not say anything
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16487
    
    2

Well, that's odd. You must not have been reading the right documentation, because when I read the documentation it says this:
The load factor is a measure of how full the hash table is allowed to get before its capacity is automatically increased.

I don't know how you could have missed that, if you had seen the right documentation.
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1303
The load factor is a measure of how full the hash table is allowed to get before its capacity is automatically increased. Thanks Paul.

Then who(initial capacity/load factor/any other value) decides number of elements in each bucket ?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16487
    
    2

I don't understand what that question means. There isn't anything which says "There will be 47 entries in each bucket" or "There will be 19 entries in bucket number 7" or anything remotely like that. That just isn't how hashing works.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: HashMap - load factor ?
 
Similar Threads
HashMap, Load Facor, Rehash Operation
Default load factor 0.75. why ?
HashMap, Load Facor, Rehash Operation
Exact HashMap Size & Load Factor
what is load factor of hashset ???