dsa11 min read
Suffix Array Construction — O(n log n) Sorting and the Kasai LCP Algorithm
A suffix array sorts all suffixes of a string lexicographically. Built in O(n log n) with prefix doubling and paired with the Kasai LCP array, it answers substring search, distinct substring count, and longest repeated substring queries in optimal time.
Read →