a trie pronounce try prefix tree tree data structure efficiently store retrieve key dataset string there application datum structure autocomplete spellcheckerimplement Trie classtrie Initializes trie objectvoid insertstre word Inserts string word trieboolean searchString word Returns true string word trie ie insert false otherwiseboolean startswithstre prefix return true previously insert string word prefix prefix false Example 1inputtrie insert search search startswith insert search apple apple app app app appoutputnull null true false true null trueExplanationTrie trie new Trietrieinsertappletriesearchapple return Truetriesearchapp return FalsetriestartsWithapp return Truetrieinsertapptriesearchapp return true constraints1 wordlength prefixlength 2000word prefix consist lowercase English lettersat 3 104 call total insert search startswith