Trie based addressbook and efficient search by nam

2020-07-21 10:41发布

it is a known approach to develop an addressbook based on trie datastructure. It is an efficient data structure for strings. Suppose if we want to create an efficient search mechanism for an address book based on names, numbers etc, what is the efficient data structure to enable memory efficient and faster search based on any type of search terms irrespective of data type?

1条回答
疯言疯语
2楼-- · 2020-07-21 11:10

This is a strange question maybe you should add more informations but you can use a trie data structure not only for strings but also for many other data types. The definition of a trie is to make a dictionnary with an adjacent tree model. I know of a kart-trie that is something similar to a trie and uses a binary tree model. So it is the same data structure but with a different tree model. The kart-trie uses a clever key-alternating algorithm to hide a trie-data structure in a binary tree. It's not a patricia trie, or a radix-trie.

  1. Good algorithm for managing configuration trees with wildcards?
  2. http://code.dogmap.org/kart/

But I think a ternary tree would do the same trick:

  1. http://en.wikipedia.org/wiki/Ternary_search_tree
  2. http://igoro.com/archive/efficient-auto-complete-with-a-ternary-search-tree/
查看更多
登录 后发表回答