About keyword search

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.

所有跟帖: 

partial match如何search其是否在hashtable中呢? -澳洲老土- 给 澳洲老土 发送悄悄话 (0 bytes) () 01/21/2009 postreply 15:39:51

Thanks a lot for the suggestion 才兄 -CatcherInTheRye- 给 CatcherInTheRye 发送悄悄话 (460 bytes) () 01/21/2009 postreply 15:43:45

对不起,看问题不仔细。 -布衣之才- 给 布衣之才 发送悄悄话 布衣之才 的博客首页 (415 bytes) () 01/22/2009 postreply 13:49:59

请您先登陆,再发跟帖!