We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91657f9 commit f37f0daCopy full SHA for f37f0da
pydatastructs/trees/trie.py
@@ -101,17 +101,6 @@ def collect_words(current_node):
101
102
return collect_words(self.root)
103
104
- def shortest_unique_prefix(self, word):
105
- """Determines the shortest unique prefix for a given word."""
106
- node = self.root
107
- prefix = ""
108
- for char in word:
109
- prefix += char
110
- if len(node.children[char].children) <= 1 and node.children[char].is_end_of_word is False :
111
- return prefix
112
- node = node.children[char]
113
- return word
114
-
115
def longest_word(self):
116
"""Finds and returns the longest word in the Trie."""
117
all_words = self.find_all_words()
0 commit comments