Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The underlying data structure (a trie[0]) is used to create both suffix trees and prefix trees. The 'default' trie is a prefix tree actually.

The reason you would want a suffix tree (over a prefix trie) is that suffix trees are quite useful for computing the longest common substring of two strings (they can do it in linear time).

[0] https://en.wikipedia.org/wiki/Trie



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: