Why ternary tries?
-
In a multiway trie, each node has number of child pointers equal to the radix R
-
This can waste a lot of space
-
consider Java Strings as keys, with each 16-bit char as a digit: radix R = 65536
-
even ASCII strings with 7-bit characters will have radix R = 128
-
... unless there are very many strings stored in the R-ary trie and the strings are very short, almost all of these child pointers will be null
-
Ternary tries avoid this space cost
-
(The tradeoff is ternary tries lose the nice worst-case guarantees of multiway tries... though their average case performance is still very good)
CONTENTS PREVIOUS NEXT