Trie
你TB了
这个作者很懒,什么都没留下…
展开
-
Trie树@hihoCoder 1014
题目链接题目分析:Trie模板题。注意题目中的cnt数组是用来计算每个节点后面跟着多少个终结点。即cnt[i] 表示以i为根的子树中有多少个终结点。这样做是用空间换时间,避免每次在求终结点的数量时要去遍历以i为根的子树。 #include <algorithm>#include <iostream>#include <string>#...原创 2018-07-26 16:53:11 · 100 阅读 · 0 评论 -
Shortest Proper Prefix@hihoCoder 1107
Query auto-completion(QAC) is widely used in many search applications. The basic idea is that when you type some string s in the search box several high-frequency queries which have s as a prefix a...原创 2018-07-27 09:04:36 · 146 阅读 · 0 评论 -
403 Forbidden@hihoCoder 1289
Little Hi runs a web server. Sometimes he has to deny access from a certain set of malicious IP addresses while his friends are still allow to access his server. To do this he writes N rules in the c...原创 2018-07-27 12:19:51 · 168 阅读 · 0 评论 -
转:浅谈Trie树(字典树)
作者:xxy出处:http://www.cnblogs.com/TheRoadToTheGold/本文版权归作者和博客园共有,欢迎转载,但转载时请保留此段声明。 Trie树(字典树)一、引入字典是干啥的?查找字的。字典树自然也是起查找作用的。查找的是啥?单词。看以下几个题:1、给出n个单词和m个询问,每次询问一个单...转载 2019-03-02 15:34:58 · 234 阅读 · 0 评论