MCPcopy Index your code
hub / github.com/OmkarPathak/pygorithm / find_words

Method find_words

pygorithm/data_structures/trie.py:52–62  ·  view source on GitHub ↗

Find all words with the given prefix

(self, prefix)

Source from the content-addressed store, hash-verified

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 """

Callers 1

test_stackMethod · 0.95

Calls 2

find_final_nodeMethod · 0.95
build_word_listMethod · 0.95

Tested by 1

test_stackMethod · 0.76