Hacker News new | ask | show | jobs
by mehrdadn 2421 days ago
The prefix tree of a string is just a linked list, though—it's the string itself. It doesn't help you do anything for a single string, unlike a suffix tree, which is used for finding substrings of a single string.

Moreover, how would you even start searching for a substring using a prefix tree? You can't start at the root, because the substring wouldn't be a prefix. It doesn't help you there at all.

1 comments

This is such a clear and illuminating explanation as to why _suffix_, rather than prefix trees, are so useful.
Thanks!