A Hundred Four Megabytes
A trie over lowercase English stores 200,000 words with characters in total. Nothing is shared in the worst case, so assume about nodes. The node is
struct Node {
int next[26]; // child index, or -1
bool isWord;
};
with sizeof(int) == 4. Roughly how much memory do the next arrays alone take, and what is the usual response when that exceeds the limit?
Sign in to answer questions and track your progress
Sign In