Thread: Hashing In C
View Single Post
Old Jan 9th, 2008, 10:05 AM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Hashing In C

Well it's almost always in the circumstance where the hash function is known. Such as there are only 26 keys between "A" and "Z" ... thus the hash function is key[0]-'A'.

The point of using the hash table is to handle any unexpected input, such as "a", "z", or "az". That's where the hash table, along with my solution, comes in.

I just need the best way to handle the scenario where the hash function is of small importance, and performance of the buckets is unimportant... whether it be something from the standard library, or a smaller version of the code I posted.

Are associative containers in C++ not usable like Hash Tables, and a part of the standard library?

P.S. I recall reading up on Bernstein's algorithm in an article you wrote, over a year ago. Good stuff.
Sane is offline   Reply With Quote