Trie based addressbook and efficient search by name and contact number
Asked Answered
M

1

3

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?

Misread answered 4/8, 2011 at 6:28 Comment(1)
Numbers are just strings of digit-characters, or at least nothing precludes you from representing them as such. I can't think of a data type that would be impossible or inefficient to represent as a string for this particular application. You probably cannot represent pictures as strings efficiently, or use a trie to search them, but then it's not your typical address book search.Lampion
B
3

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/
Barmecidal answered 4/8, 2011 at 7:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.