字典树
文章平均质量分 71
普通网友
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
字典树(待补充)
字典树讲解:(总的思路) 字典树与字典很相似,当你要查一个单词是不是在字典树中,首先看单词的第一个字母是不是在字典的第一层,如果不在,说明字典树里没有该单词,如果在就在该 字母的孩子节点里找是不是有单词的第二个字母,没有说明没有该单词,有的话用同样的方法继续查找.字典树不仅可以用来储存字母,也可以储存数字等其它数 据。 它的优点是:利用字符串的公共前缀来节约存储空间原创 2014-02-24 19:11:21 · 674 阅读 · 2 评论 -
hdu 1251 统计难题
题目链接 Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词原创 2014-02-25 16:26:33 · 450 阅读 · 0 评论 -
poj 2001 Shortest Prefixes 还不是很没明白,还得再理解理解
题目链接 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "carbo", and "carbon". Note th原创 2014-02-25 20:48:44 · 512 阅读 · 0 评论 -
hdu 1247 hat‘s word
题目链接 Problem Description A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the hat’s words in a dictio原创 2014-02-26 16:01:58 · 535 阅读 · 0 评论
分享