Autocomplete using a trie

后端 未结 2 2029
被撕碎了的回忆
被撕碎了的回忆 2020-12-07 18:02

I am working on an autocompletion script and was thinking about using a trie. My problem is I want everything that matches to be returned. So for example I type in the let

2条回答
  •  被撕碎了的回忆
    2020-12-07 18:44

    Regarding the time to discover items at a root note, if you're doing this for an autocomplete, it's likely you won't be returning too many results per 'match'. If you wanted to trade off space for speed, you could store references to the 'top n' items at each of the nodes. This, of course, would require more time on update

提交回复
热议问题