Can someone help me understand tries in python? I was given this question but I am absolutely lost
Write the class method Trie.add, that consumes a Str and mutates the Trie so it also stores the new value. It returns None. For example, adding the word 'yo' to an empty Trie will cause it to look like: Trie ({ 'y': Trie ({ 'o': Trie ({ ' ': None }) }) }) If you further add 'ya', it will look like: Trie ({ 'y': Trie ({ 'o': Trie ({ ' ': None }) , 'a': Trie ({ ' ': None }) }) }) Let sample be an empty Trie. Add the words ['a', 'an', 'and', 'was', 'wax', 'way', 'win'] in order. Then sample will have the value: Trie ({ 'a': Trie ({ ' ': None , 'n': Trie ({ ' ': None , 'd': Trie ({ ' ': None }) }) }) , 'w': Trie ({ 'a': Trie ({ 's': Trie ({ ' ': None }) , 'x': Trie ({ ' ': None }) , 'y': Trie ({ ' ': None }) }) , 'i': Trie ({ 'n': Trie ({ ' ': None }) }) }) })