Find all words with the given prefix
(self, prefix)
| 50 | return False |
| 51 | |
| 52 | def find_words(self, prefix): |
| 53 | """ |
| 54 | Find all words with the given prefix |
| 55 | """ |
| 56 | v = self.find_final_node(prefix) |
| 57 | wList = self.build_word_list(v, prefix) |
| 58 | if(v and v.word): |
| 59 | #v exists and the prefix is itself a word; add it to the list. |
| 60 | wList.append(prefix) |
| 61 | |
| 62 | return wList |
| 63 | |
| 64 | def find_final_node(self, word): |
| 65 | """ |