• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

load factor in collections

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,
Am trying to understand the load factor concept .

Have a couple of questions regarding the same ::

Is load factor only applicable to Maps ?
Is it applicable to List ?

Also was reading this article ::
http://www.oracle.com/technology/pub/articles/maps1.html

An excerpt ::


The load factor itself is a tuning tradeoff between space and time. Smaller load factors will take more space but will reduce the likelihood of collisions, thus making access and updates faster. Load factors above 0.75 are probably unwise, and above 1.0 are definitely unwise since that guarantees at least one collision. Load factors below 0.50 will give you diminishing returns, but there should be no performance cost to small load factors as long as you size the map effectively, only a memory cost. But smaller load factors will imply more frequent resizing if you don't pre-size the Map, and that will incur a performance penalty, so do bear that in mind if you are tuning the load factor



Not understood what is collission - is this something specific to how hash implementations are done ?

Could someone throw some pointers ?

Thanks ,
~satish
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Load factor is specific to hashed collections. Lists are unlikely to have a concept of load factor.

The article to which you refer has an explanation of how hashing works. Did you read it?
 
satish bodas
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I did read the article but have not understood / digested the details .
Will read it once more and come up with the points I dont understand .

Thanks ,
~satish
 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The meaning of "load factor of a hashtable=0.75" is if the hashtable is 75% full, then it will be re-hashed two times of the initial capacity.
 
reply
    Bookmark Topic Watch Topic
  • New Topic