Does it help to store keywords in the order of hashcode instead of alphabetic order?
1 Store keywords in a hashtable, with the key = hashcode, and value is a string array to store keywords with same hashcode in alphabetic order.
2 For incoming word, hash it, and search for the hashcode in the dictionary.
3 If the hashcode is found, search the string array for the incoming word.
It should be much fast to find an entry in hashtable, and the string array should be short for each hashcode.
About keyword search
所有跟帖:
•
partial match如何search其是否在hashtable中呢?
-澳洲老土-
♂
(0 bytes)
()
01/21/2009 postreply
15:39:51
•
Thanks a lot for the suggestion 才兄
-CatcherInTheRye-
♂
(460 bytes)
()
01/21/2009 postreply
15:43:45
•
对不起,看问题不仔细。
-布衣之才-
♂
(415 bytes)
()
01/22/2009 postreply
13:49:59