zudokod
zudokod

Reputation: 4094

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 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?

Upvotes: 3

Views: 4168

Answers (1)

Cybercartel
Cybercartel

Reputation: 12592

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/

Upvotes: 3

Related Questions