in computer science, the longest common prefix array (lcp array) is an auxiliary data structure to the suffix array. it stores the lengths of the longest common prefixes (lcps) between all pairs of consecutive suffixes in a sorted suffix array.