This paper proposed a storing approach for trie structures, called Coordinate Hash Trie. The basic idea is using a global hash table with a special hash function to store all edges of a trie. For a trie with $n$ nodes and an alphabet with size $m$, the execution time of finding, inserting and deleting a child node, is $O(1)$ for the average case, $O(m)$ for the worst case. The space used by this approach is $O(n)$, unrelated to $m$. The constant of space consumption is predictable, with no need for reallocation or resizing. In addition, this approach is very easy to implement.
翻译:本文提出了一种针对Trie结构的存储方法,称为坐标哈希Trie(Coordinate Hash Trie)。其核心思想是利用全局哈希表配合特殊哈希函数来存储Trie的所有边。对于包含$n$个节点且字母表大小为$m$的Trie,查找、插入和删除子节点的平均时间复杂度为$O(1)$,最坏情况下为$O(m)$。该方法的空间消耗为$O(n)$,与$m$无关。空间消耗的常数因子可预测,无需进行内存重分配或扩容操作。此外,该方法实现非常简单。