4 ms·
I'm going by the abstract here, but: You'd build the suffix tree from the haystack, whereas their algorithm preprocesses the needle. So I guess it mostly depe
by pmjordan 11y ago
I'm going by the abstract here, but:
You'd build the suffix tree from the haystack, whereas their algorithm preprocesses the needle.
So I guess it mostly depends if you're going to be repeatedly searching different strings in the same document, or if you're searching for the same string in many different documents. Plus, space requirements might be relevant too, as a preprocessed haystack is probably bigger than a preprocessed needle.