Following is the Suffix array
and LCP array
information for string MISSISSIPPI
. I know that LCP
gives information about the lenght of the longest common prefix between str[i - 1]
and str[i]
. How Do I get longest common prefix length between any two arbitrary suffixes of this string. For example, I want longest common prefix between MISSISSIPPI
and ISSIPPI
SA LCP
12 0 $
11 0 I$
8 1 IPPI$
5 1 ISSIPPI$
2 4 ISSISSIPPI$
1 0 MISSISSIPPI$
10 0 PI$
9 1 PPI$
7 0 SIPPI$
4 2 SISSIPPI$
6 1 SSIPPI$
3 3 SSISSIPPI$