posted 23 years ago
Hash tables /Hashmap/Hashset is like a dictionary ,
it maps keys to specific values.
A key finds a value in a array like structure.
It is called hashing because when one converts
keys into subscripts it scrambles the bits. the bits
form a number that is useful to store and retreive data.
A problem with hashtables is collisions ( 2 keys for the
same cell) To prevent this every cell in a hashtable
is also a bucket ( a linked list ) of all the key and
value pairs that match that specific cell.
The package java.util uses this for hashtables.
The load factor in hashing is the ratio of filled cells
to the size of the hashtable. The higher the number , the
more likely collisions are!