c++ - String hashing with linear probing -


I am trying to figure out how to do string hashing with linear probes.

Actually,

I have done this:

  1. A hash table has been created:

    One Every string has to be from the dictionary (90000 words), and to retrieve the anagrams of the selected words. 2 * 90000 in size

  2. Using a simple hash function, I get the word from each word, get a value

  3. If that hash table index is empty, check if the value is, otherwise, create a new hash value.

  4. Each word is in the hash table, and I execute a search

  5. After the hash function, The hash value will be received, and it will be checked whether the value exists in the hash table.

  6. If it exists, then it will compare permutations compared to struts. If the match is true, then it will output. If not, then it is using a new hash value.

The problem is that the whole process is very slow ... it's fine, but the search takes a long time.

How I am out of ideas about how to make it fast ..

Thank you for your reading.

Put all the letters in alphabetical order first, then you get results with any hashing algorithm (crc32, Md5sum, sha1, calculation of vowels, anything ... though can be a less-efficient solution due to counting of vowels), and that hash entry (in a link list, obviously) for words as a leaf node Accumulate - 2 ^ x to limit a bucket to a modern (x) result on hash result

Then, when you find an anagram, then perform the exact same "Insert" process on your test word: alphabetically, then it's your own hash Function Then for each leaf node, compare the alphabetical alphabetical list with the description of the letters described.

(I usually do not like to give homework assistance, but it was a very attractive one. Now I want to write a fun program to find all the organs in a way.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -