longest sub array Algorithm

augment the suffix array with the LCP array lets one to efficiently simulate top-down and bottom-up traversals of the suffix tree, speeds up shape matching on the suffix array and is a prerequisite for compressed suffix trees. It stores the lengths of the longest common prefixes (LCPs) between all pairs of consecutive suffixes in a sorted suffix array. The LCP array was introduced in 1993, by Udi Manber and gene Myers alongside the suffix array in order to better the working time of their string search algorithm.

longest sub array source code, pseudocode and analysis