Trie based addressbook and efficient search by name and contact number
it is a known approach to develop an addressbook based on trie datastructure. It is an efficient data structure 开发者_JS百科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?
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.
- Good algorithm for managing configuration trees with wildcards?
- http://code.dogmap.org/kart/
But I think a ternary tree would do the same trick:
- http://en.wikipedia.org/wiki/Ternary_search_tree
- http://igoro.com/archive/efficient-auto-complete-with-a-ternary-search-tree/
精彩评论