字典树trie
liuchenjane
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
字典树(Trie)
字典树 字典树,又称单词查找树,Trie树,是一种树形结构,是一种哈希树的变种。典型应用是用于统计,排序和保存大量的字符串(但不仅限于字符串),所以经常被搜索引擎系统用于文本词频统计。它的优点是:利用字符串的公共前缀来减少查询时间,最大限度地减少无谓的字符串比较,查询效率比哈希树高。 应用 (1)自动匹配 (2)拼写检查 (3)IP路由(寻找最长匹配) (4)T9文本输入翻译 2016-11-27 15:03:23 · 288 阅读 · 0 评论 -
421. Maximum XOR of Two Numbers in an Array
Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231.Find the maximum result of ai XOR aj, where 0 ≤ i, j < n.Could you do this in O(n) runtime? Example:Input: [3, 10, 5, 25, 2转载 2016-11-27 21:49:59 · 531 阅读 · 0 评论 -
211. Add and Search Word - Data structure design
Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing only letters转载 2016-11-28 10:08:48 · 567 阅读 · 0 评论
分享