Implement Trie (Prefix Tree)
A trie (prefix tree) is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. Implement the Trie class with insert, search, and startsWith methods.
Implement Trie (Prefix Tree)

A trie (prefix tree) is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. Implement the Trie class with insert, search, and startsWith methods.

Example 1:
Input: {"operations":["Trie","insert","search","search","startsWith","insert","search"],"args":[[],["apple"],["apple"],["app"],["app"],["app"],["app"]]}
Output: [null,null,true,false,true,null,true]
Input
arr ={"operations":["Trie","insert","search","search","startsWith","insert","search"],"args":[[],["apple"],["apple"],["app"],["app"],["app"],["app"]]}

Initialize empty Trie

Trie StructurerootEmpty Trie
Current
In Path
Word End
Variables
VariableValue
stepinit
path
resultnull
DepthFunction Call
Stack empty
0/34