Open yozyyyqls opened 1 year ago
Trie is a data structure used to retrieve a key in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker.
The definition of the node in the prefix tree:
class TrieNode:
self.children = {}
# It is essential and easy to ignore that we should mark the end of a word.
self.endOfWord = False
Anagram
An anagram is a word formed by rearranging the letters of a word, typically using the original letters only once.