Why it matters

LCP + SA = versatile string toolkit. Understanding shapes string querying.

Advertisement

The architecture

LCP[i] = |lcp(suffix(SA[i-1]), suffix(SA[i]))|.

Kasai: O(n) from SA + rank array.

LCP constructionSA + rankinputKasai algorithmO(n) scanLCP arrayadjacent LCPsCombined with SA, enables suffix tree operations in less memory
LCP.
Advertisement

How it works end to end

RMQ on LCP: any two suffixes LCP.

Longest repeated substring: max(LCP).

Suffix tree operations.