我正在尝试在 C++ 中进行尝试,现在我的基本数据结构看起来像..
struct node{
int count; no of times this node has been visited.
struct node* child[ALPHABET_SIZE]; // Let ALPHABET_SIZE be 26
}
当字符串大小变大时,会浪费大量分配的内存。就像我们插入"he"
我们的树一样
root---->h--->e
|--->e
我们看到在根目录中只有2/26th
分配的内存被使用。怎么提高 ??.