摘要:
字典树模板题。CODE:字典树#include<iostream>usingnamespacestd;structTrie{Trie*next[26];intcount,value;Trie(){for(inti=0;i<26;i++)next[i]=0;value=0;count=1;}};voidinsert(Trie*&root,char*s){inti=0,branch=0;Trie*p=root;if(!p){p=newTrie();root=p;}while(s[i]){branch=s[i]-'a';if(p->next[branc 阅读全文
posted @ 2012-09-11 20:09
有间博客
阅读(192)
评论(0)
推荐(0)