MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / find

Method find

data_structures/trie/trie.py:36–47  ·  view source on GitHub ↗

Tries to find word in a Trie :param word: word to look for :return: Returns True if word is found, False otherwise

(self, word: str)

Source from the content-addressed store, hash-verified

34 curr.is_leaf = True
35
36 def find(self, word: str) -> bool:
37 """
38 Tries to find word in a Trie
39 :param word: word to look for
40 :return: Returns True if word is found, False otherwise
41 """
42 curr = self
43 for char in word:
44 if char not in curr.nodes:
45 return False
46 curr = curr.nodes[char]
47 return curr.is_leaf
48
49 def delete(self, word: str) -> None:
50 """

Callers 15

test_trieFunction · 0.95
stock_priceFunction · 0.45
get_citationFunction · 0.45
extract_user_profileFunction · 0.45
search_scraperFunction · 0.45
get_anime_episodeFunction · 0.45
download_imageFunction · 0.45
horoscopeFunction · 0.45
random_anime_characterFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_trieFunction · 0.76