特里基于通讯录和姓名及联络电话号码高效的搜索 [英] Trie based addressbook and efficient search by name and contact number

查看:116
本文介绍了特里基于通讯录和姓名及联络电话号码高效的搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个众所周知的方法来开发基于特里数据结构的地址簿。它是一个有效的数据结构的字符串。假设,如果我们想创建一个高效的搜索机制的基础上姓名,号码等地址簿,什么是有效的数据结构,使内存使用效率和更快的基于任何类型的搜索词,不论数据类型的搜索?

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?

推荐答案

这是一个奇怪的问题,也许你应该增加更多的信息,但是你可以用一个线索的数据结构,不仅为字符串,但是也为许多其它数据类型。一线索的定义是,使一个dictionnary与相邻的树模型。我知道一个卡丁车 - 特里类似于一个线索的东西,并使用二叉​​树模型。因此,它是相同的数据结构,但使用不同的树模型。卡丁车 - 特里使用智能钥匙交替算法,在二叉树隐藏特里数据结构。这不是一个帕特里夏线索,或基数线索。

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. <一个href="http://stackoverflow.com/questions/5416778/good-algorithm-for-managing-configuration-trees-with-wildcards">Good算法来管理使用通配符配置树?
  2. HTTP://$c$c.dogmap.org/kart/
  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 /高效,自动完成上带有一个三元搜索树/
  1. http://en.wikipedia.org/wiki/Ternary_search_tree
  2. http://igoro.com/archive/efficient-auto-complete-with-a-ternary-search-tree/

这篇关于特里基于通讯录和姓名及联络电话号码高效的搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆