Fork me on GitHub
摘要: 较简单字典树,每输入一对字符串,前一个放在字典(数组)中,后一个插入字典树中,并将其最终的flag赋为前一个在数组中的下标,再就好找了。输入的处理方法要注意一下。 代码:#include #include #include #include #include #include #include #include using namespace std;#define N 100027struct node{ int flag; node *next[26];}*root;char dic[N][11];node *create(){ node *p; p = (nod... 阅读全文
posted @ 2014-02-11 16:47 whatbeg 阅读(207) 评论(0) 推荐(0)