4 ms·
For most problems, a prefix tree will be just as useful. But suppose you want to look for the best match of string in a data stream with no predetermined lengt
by nroets 7y ago
For most problems, a prefix tree will be just as useful.
But suppose you want to look for the best match of string in a data stream with no predetermined length e.g. a TCP pipe. Then a suffix tree will allow you to process each incoming character in constant time. A prefix tree will not.