Trie based addressbook and efficient search by name and contact number

拈花ヽ惹草 提交于 2019-12-06 06:48:35

问题


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:


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/


来源:https://stackoverflow.com/questions/6937059/trie-based-addressbook-and-efficient-search-by-name-and-contact-number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!