Overview
A suffix array supports binary search over suffixes and often pairs with LCP arrays for efficient string queries.
Stores suffix starting positions in lexicographic order for compact string indexing.
Compact metadata for implementation and discovery.
A suffix array supports binary search over suffixes and often pairs with LCP arrays for efficient string queries.
Quick facts
Runtime and memory behavior at a glance.
Best
O(m log n)
Average
O(m log n)
Worst
O(m log n)
Space
O(n)
text[suffix_array[i]..] <= text[suffix_array[i+1]..]Defines the sorted order stored by the suffix array.
Show the structure layout and how operations move through or update it.
Suffix Array 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 Array's pattern matching, suffix indexing, alignment, or sequence-processing mechanism.
Open sourceTextbook support for Suffix Array's algorithm family, complexity framing, and standard implementation concepts.
Open sourceOriginal reference introducing suffix arrays as a space-efficient string index.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Pattern Matching · Core
A suffix array with LCP values can also find longest common substrings after combining the strings.
Compare with thisData Structures · Core
Suffix arrays are more compact than suffix trees for many workloads.
Compare with thisPattern Matching · Specialized
FM-Index Search offers a different exact, approximate, or indexed matching strategy than Suffix Array.
Compare with thisPattern Matching · Extended
Suffix array search uses the sorted suffix array as its index.
Compare with thisSuffix array search uses the sorted suffix array as its index.
Suffix arrays are more compact than suffix trees for many workloads.