SPOJPL/LongestCommonSubstring2.cpp
void compute_lcp() {
	int len = 0;
	for(int i = 0; i < AN; i++, len = max(0, len - 1)) {
		int s = REVSA[i];
		int j = SA[s - 1];
		for(; i + len < AN && j + len < AN && A[i + len] == A[j + len]; len++);
		LCP[s] = len;
	}
}
/* Computes the longest common prefix between adjacent suffixes.  LCP[i] gives
 * the longest common suffix between the suffix starting at i and the next
 * smallest suffix.  Runs in O(N) time.
 */
Computes the longest common prefix between adjacent suffixes.  LCP[i] gives
the longest common suffix between the suffix starting at i and the next
smallest suffix.
Computes the longest common prefix between adjacent suffixes . LCP [ i ] gives the longest common suffix between the suffix starting at i and the next smallest suffix .
void compute_lcp() {
	int len = 0;
	for(int i = 0; i < AN; i++, len = max(0, len - 1)) {
		int s = REVSA[i];
		int j = SA[s - 1];
		for(; i + len < AN && j + len < AN && A[i + len] == A[j + len]; len++);
		LCP[s] = len;
	}
}
void compute_lcp ( ) { int len = 0 ; for ( int i = 0 ; i < AN ; i ++ , len = max ( 0 , len - 1 ) ) { int s = REVSA [ i ] ; int j = SA [ s - 1 ] ; for ( ; i + len < AN && j + len < AN && A [ i + len ] == A [ j + len ] ; len ++ ) ; LCP [ s ] = len ; } }
Computes the longest common prefix between adjacent suffixes.
Computes the longest common prefix between adjacent suffixes .