A trie (pronounced as 'try') or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker. Implement the `Trie` class: `Trie()`, `insert(word)`, `search(word)`, `startsWith(prefix)`.
Prefix Tree (Trie) Node Design
A Trie is a tree where each node represents a single character of a string. The root node is usually empty. Each node has: 1. A dictionary or array of children (mapping character to the next TrieNode). 2. A boolean flag `isEndOfWord` to indicate if a complete word ends at this node. This allows for prefix searches and word lookups in $O(L)$ time, where $L$ is the length of the string.