Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what are buckets in hash table

 
Srinivasa Datla
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recently i read Hash table contains buckets. Can anybody explain these?

- Srinivasa
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A bucket is an abstract term for a container that can hold a value. The hash value is used to decide which bucket to store the value in.

In Java, the buckets are typically implemented as an array of object references.

Does that help?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic