You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
struct node
|
|
{
|
|
node *trans[26];
|
|
int cnt;
|
|
};
|
|
void insert(node *n, char *str)
|
|
{
|
|
for (; *str; n = n->trans[*str - '0'])
|
|
if (n->trans[*str - '0'] == 0)
|
|
n->trans[*str - '0'] = new_node();
|
|
n->cnt++;
|
|
} |