![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字典树
文章平均质量分 82
Czayzx
努力想成为大佬的菜鸡。
展开
-
字典树
一:插入 void insert()//插入单词s { len=strlen(s);//单词s的长度 root=0;//根节点编号为0 for(int i=0;i<len;i++) { int id=s[i]-'a';//第二种编号 if(!trie[root][id])//如果之前没有从root到id的前缀 ...转载 2018-08-07 16:29:35 · 104 阅读 · 0 评论 -
Shortest Prefixes(字典树)
题目: 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 that the empty string is...原创 2018-08-07 16:37:07 · 235 阅读 · 0 评论