MCPcopy Index your code
hub / github.com/ndleah/python-mini-project / insert

Method insert

Prefix_Trie/trie.py:17–23  ·  view source on GitHub ↗
(self, word: str)

Source from the content-addressed store, hash-verified

15 Inserts the string word into the trie.
16 """
17 def insert(self, word: str) -> None:
18 curr = self.root
19 for c in word:
20 if c not in curr.children:
21 curr.children[c] = TrieNode()
22 curr = curr.children[c]
23 curr.is_end = True
24
25 """
26 Returns true if the string word is in the trie (i.e., was inserted before).

Callers 8

calculateFunction · 0.80
get_productsMethod · 0.80
update_tableMethod · 0.80
main.pyFile · 0.80
calculateFunction · 0.80
on_sendFunction · 0.80
widgetsMethod · 0.80
rollFunction · 0.80

Calls 1

TrieNodeClass · 0.85

Tested by

no test coverage detected