Searches for given word in trie. We want to find the last node for the word. If we can't, then it means the word is not in the trie.
(self, word)
| 40 | curr = curr.children[c] |
| 41 | |
| 42 | def search(self, word): |
| 43 | """ |
| 44 | Searches for given word in trie. We want to find the last node for the |
| 45 | word. If we can't, then it means the word is not in the trie. |
| 46 | """ |
| 47 | if self.find_final_node(word): |
| 48 | return True |
| 49 | else: |
| 50 | return False |
| 51 | |
| 52 | def find_words(self, prefix): |
| 53 | """ |