| 31 | } |
| 32 | |
| 33 | void insert(string word) { |
| 34 | Node* curr = root; |
| 35 | |
| 36 | for(auto &ch:word){ |
| 37 | if(curr -> child[ch - 97] == NULL) |
| 38 | curr -> child[ch - 97] = new Node(ch); |
| 39 | curr = curr -> child[ch - 97]; |
| 40 | } |
| 41 | |
| 42 | curr -> isWord = true; |
| 43 | } |
| 44 | |
| 45 | bool search(string word) { |
| 46 | Node* reqNode = getNode(word); |
no outgoing calls
no test coverage detected