|
本帖最后由 coder 于 2011-8-25 22:00 编辑
还没仔细研究,因为构造的code貌似十分麻烦,我还不会。但构造一个generalized suffix tree 需要O(set of strings的总长度),不是O(n+L),sorry, where n is the quantity of strings, L is the longest length. 查找不需遍历,我的理解是第一个分叉点以前的就是prefix.
FYI,http://en.wikipedia.org/wiki/Generalised_suffix_tree |
|