• Post Reply Bookmark Topic Watch Topic
  • New Topic

HashMap - load factor ?  RSS feed

 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any update ?
 
Stephan van Hulst
Saloon Keeper
Posts: 7987
143
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What did the documentation say?
 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Document did not say anything
 
Paul Clapham
Sheriff
Posts: 22829
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 22829
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!