Overview
A suffix tree compresses chains of suffix trie edges, enabling many substring and pattern queries in linear or near-linear time.
Stores all suffixes of a string in a compressed trie for fast substring queries.
Compact metadata for implementation and discovery.
A suffix tree compresses chains of suffix trie edges, enabling many substring and pattern queries in linear or near-linear time.
Quick facts
Runtime and memory behavior at a glance.
Best
O(m)
Average
O(m)
Worst
O(m)
Space
O(n)
Show the structure layout and how operations move through or update it.
Suffix Tree should be used with the assumptions and tradeoffs of string Index in mind.
What each reference supports for this entry.
String algorithms reference for Suffix Tree's pattern matching, suffix indexing, alignment, or sequence-processing mechanism.
Open sourceTextbook support for Suffix Tree's algorithm family, complexity framing, and standard implementation concepts.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Data Structures · Core
Ropes optimize editable text storage, while suffix trees index substrings for search.
Compare with thisData Structures · Core
Suffix trees and suffix arrays are different full-text index structures.
Compare with thisPattern Matching · Core
Suffix trees provide another indexed structure for longest common substring queries.
Compare with thisPattern Matching · Extended
Suffix arrays and suffix trees support substring queries with different space tradeoffs.
Compare with thisSuffix trees and suffix arrays are different full-text index structures.
Both compactly represent substring structure.