Range LCP

Amihood Amir, Alberto Apostolico, Gad M. Landau, Avivit Levy, Moshe Lewenstein, Ely Porat

Research output: Contribution to journalArticlepeer-review


In this paper, we define the Range LCP problem as follows. Preprocess a string S, of length n, to enable efficient solutions of the following query: Given [i,j], 0<i≤j≤n, compute maxℓ,k[i..j]LCP(S ,Sk), where LCP(S,Sk) is the length of the longest common prefix of the suffixes of S starting at locations ℓ and k. This is a natural generalization of the classical LCP problem. We provide algorithms with the following complexities: Preprocessing Time: O(|S|), Space: O(|S|), Query Time: O(|j-i|loglogn).Preprocessing Time: none, Space: O(|j-i|log|j-i|), Query Time: O(|j-i|log|j-i|). However, the query just gives the pairs with the longest LCP, not the LCP itself.Preprocessing Time: O(|S|log2|S|), Space: O(|S|log1|S|) for arbitrary small constant ε, Query Time: O(loglog|S|).

Original languageEnglish
Pages (from-to)1245-1253
Number of pages9
JournalJournal of Computer and System Sciences
Issue number7
StatePublished - Nov 2014


  • Data structures
  • LCP
  • Pattern matching

ASJC Scopus subject areas

  • Theoretical Computer Science
  • Computer Networks and Communications
  • Computational Theory and Mathematics
  • Applied Mathematics


Dive into the research topics of 'Range LCP'. Together they form a unique fingerprint.

Cite this