How to implement incremental search on a list

前端 未结 7 2098
无人共我
无人共我 2021-02-06 04:52

I want to implement incremental search on a list of strings. Consider I have an array containing which contains the strings store,state,stamp,crawl,crow. My application has a te

7条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-06 05:10

    Well, I have implemented a Trie and a DAWG for this problem and I stumbled upon 2 head scratchers:

    1) DAWG --> Directed ACYCLIC Word Graph. How do you create this graph/traverse it with words like 'bot' and 'boot' the 'oo' in boot would cause a cycle based on a DAWG 2) A Trie eliminates this problem but then introduces some branch managing problems.

    Constructing the graph is much easier (IMO) than actually using it to produce the words you want without also incurring more runtime.

    I am still working on this.

提交回复
热议问题