本文共 299 字,大约阅读时间需要 1 分钟。
字典树入门题
将字符串结尾的标记为一个字符串,然后就可以用字典树的插入和查找了
代码如下:
#include#include #include using namespace std;#define maxn 26typedef struct{ char str[13]; int next[maxn];}N;N node[300001];int top;void insert(char *str,char *str1){ int len=strlen(str); int t=0; for(int i=0;i
转载地址:http://zkrfb.baihongyu.com/