Sunday, December 4, 2011

Hashing (Java)

Hashing, a technique used (among other applications) to implement Java's common map and set classes. Hashing is designed to solve the problem of needing to efficiently find or store an item in a collection. For example, if we have a list of 10,000 words of English and we want to check if a given word is in the list, it would be inefficient to successively compare the word with all 10,000 items until we find a match. Hashing is a technique to make things more efficient by effectively narrowing down the search at the outset.

What is hashing?

Hashing means using some function or algorithm to map object data to some representative integer value. This so-called hash code (or simply hash) can then be used as a way to narrow down our search when looking for the item in the map.

Hashing's concept is explained from very basic to detailed steps over here - Javamex.com

Readings for Hashing -

1. Reading 1 (Basic understanding)
2. Reading 2 (Java HashMaps)
3. Reading 3 (Further down in Hashing & HashMaps)
4. Reading 4 (Improving Hash function)
5. Reading 5 (String Hash function as implemented in Java)
6. Reading 6 (Digging in binary Implementations)
7. Reading 7 (String Hash function technical details)
8. Reading 8 (String Hash function technical details 2)
9. Reading 9 (Writing a hash function in Java, implementing hashcode)
10. Reading 10 (Hash Code advanced)

No comments:

Post a Comment