Hashcode - What are they?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   danny_regis
Posted On:   Monday, May 13, 2002 01:23 PM

Could someone please explain in simple terms what a hashcode is and how they relate to collections
Cheers
Danny

Re: Hashcode - What are they?

Posted By:   Simon_Ablett  
Posted On:   Tuesday, May 14, 2002 03:33 AM

Given a character string, a hashing algorithm will generate a unique numeric value for that string. This numeric value is known as the string's hashcode. No two, non-identical, strings should have the same hashcode (given a decent hashing algorithm!!). This is the principal behind hashtables etc. The string used as the key is converted to a hashcode and is used as an index into the data collection. There are lots of books on such algorithms if you are interested - have a look at 'Fundamental Algorithms', for example, by Donald Knuth.

Regards.
About | Sitemap | Contact