Re:The Trie: A Neglected Data Structure
by tmoertel on Friday September 13, 2013 @12:41PM
(#6381556)
The original article uses Java, which makes it harder to see how simple it can be to make and use prefix trees. For comparison, here's the Python code to create a prefix tree from a set of words:
For example:
To query whether a word is present in a tree you basically compute
and test whether the result (a forest) has an end-of-word '$$' tree.
[ Parent
| on HN ]
There are no comments on this comment yet.