About keyword search

來源: 布衣之才 2009-01-21 15:20:45 [] [博客] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (528 bytes)
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

請您先登陸,再發跟帖!

發現Adblock插件

如要繼續瀏覽
請支持本站 請務必在本站關閉/移除任何Adblock

關閉Adblock後 請點擊

請參考如何關閉Adblock/Adblock plus

安裝Adblock plus用戶請點擊瀏覽器圖標
選擇“Disable on www.wenxuecity.com”

安裝Adblock用戶請點擊圖標
選擇“don't run on pages on this domain”