This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Hashing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Hashing" Watch "Hashing" New topic


Nedungadi Poornima

Joined: Sep 13, 2005
Posts: 6
What is hashing? & how Hashtable works in Java?
Sunil Kumar Gupta
Ranch Hand

Joined: Aug 26, 2005
Posts: 824
Hashing is a common method of accessing data records. Consider, for example, a list of names:

John Smith
Sarah Jones
Roger Adams

To create an index, called a hash table, for these records, you would apply a formula to each name to produce a unique numeric value. So you might get something like:

1345873 John smith
3097905 Sarah Jones
4060964 Roger Adams

Then to search for the record containing <B>Sarah Jones</B>,
you just need to reapply the formula, which directly
yields the index key to the record. This is much more efficient than searching through all the records till the matching record is found.

Lack of will power has caused more failure than lack of intelligence or ability.
My Blog | Red5 Resources | Technology Update | Daily Technology Tips
Nedungadi Poornima

Joined: Sep 13, 2005
Posts: 6
Thnx a lot Sunil..
It is sorta covered in the JavaRanch Style Guide.
subject: Hashing
Similar Threads
How to write a spell checker?
Encryption and Decryption
Encrypt / Decrypt 10 digit Number
Encryption/decryption using core java and then insert into database
what is hashing and re-hashing?