>>it is a string that i am planning to enter, so how am i going to generate the index of the word, and how to do the hashing and rehashing, are there any predifined functions for thses. ?
Not that I know of.
When I think of hash tables I think of the "index" as being some integer value determined by a hash function. The hash function is whatever you want it to be, maybe something like the sum of all the ASCII values for all the char of the string modulo 26 then add 1 to place the index in a range from 1 to 26 inclusive. The hash function can be whatever you wish, though. The index then indicates how far from an arbitrary spot (say the beginning of a list or the first element of an array) you go to enter the current element of the hash table. Given that many hash tables don't have an entry at every possible index, I tend to think of arrays rather than lists to create them, but I am not a big user of hash tables so I don't know if there is a prefered container on which to develop the table or not.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Offline 2,253 posts
since Jul 2005