Hello,
I am stuck trying to figure out how to do string hashing with linear probing.
Basically, the idea is to hash every string from a dictionary (90000 words), and retrieve anagrams of selected words.
Here's what I did:
created a hash table 2*90000 in size
using a simple hash function, I hash each word from the dictionary, get a value
check if that hash table index is empty, if it is, assign the value, if not, generate a new hash value.
after every word is in the hash table, and I perform a search
the search word will receive a hash value after the hash function, and it will be checked whether that value exists in the hash table or not.
if it exists, it will compare the string using permutations. if the match is true, it will output it. if not, it will keep looking using a new hash value.
problem is, the whole process is extremely slow... it indexes fine, but searching takes REALLY long time.
I am out of ideas on how to make this faster..
Thank you for your time reading this.