|
@@ -15,7 +15,7 @@ struct Trie {
|
|
|
L=0;
|
|
|
root = newnode();
|
|
|
}
|
|
|
- void insert(char buf[]) {
|
|
|
+ void insert(const char buf[]) {
|
|
|
int len = strlen(buf);
|
|
|
int now = root;
|
|
|
for (int i = 0; i < len; i++) {
|
|
@@ -47,7 +47,7 @@ struct Trie {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- int query(char buf[]) {
|
|
|
+ int query(const char buf[]) {
|
|
|
int len = strlen(buf);
|
|
|
int now = root;
|
|
|
int res = 0;
|