我正在阅读有关特里数据结构的内容,并找到了两个实现来实现特里节点中的子节点。以下是两种实现的详细信息:-
1) 长度为 26 的 Trie 节点数组已用于存储 Trie 节点的子节点。
2) HashMap 已被用于存储以字符为键、以 Trie 节点为值的 trie 节点的子节点。
请让我知道哪种实现更好,为什么?
arrays algorithm hashmap trie data-structures
algorithm ×1
arrays ×1
data-structures ×1
hashmap ×1
trie ×1