这里涉及左孩子右兄弟的遍历方法,dfs在dfsnextsibling是floor 并不加一
#include<cstdio>
#include <vector>
#include<cstring>
#include<iostream>
#include <set>
#include <algorithm>
using namespace std;
#define INF 1000000;
typedef struct node{
char c;
int tot;
node *firstchild,*nextsibling;
node():c('\0'),tot(0),firstchild(NULL),nextsibling(NULL){}
}node,*pointer;
struct Trie{
pointer root;
Trie(){root=new node();}
void insert(char* s,int n ){
pointer u......
阅读全文