Range LCP

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

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

4 Scopus citations


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 , S k), where LCP(S , S k ) 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. Surprisingly, while it is known how to preprocess a string in linear time to enable LCP computation of two suffixes in constant time, this seems quite difficult in the Range LCP problem. It is trivial to answer such queries in time O(|j - i| 2) after a linear-time preprocessing and easy to show an O(1) query algorithm after an O(|S| 2) time preprocessing. We provide algorithms that solve the problem with the following complexities: 1. Preprocessing Time: O(|S|), Space: O(|S|), Query Time: O(|j - i|log log n). 2. Preprocessing Time: no preprocessing, 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. 3. Preprocessing Time: O(|S|log 2 |S|), Space: O(|S|log 1 + ε |S|) for arbitrary small constant ε, Query Time: O(log log |S|).

Original languageEnglish
Title of host publicationAlgorithms and Computation - 22nd International Symposium, ISAAC 2011, Proceedings
Number of pages10
StatePublished - 2011
Event22nd International Symposium on Algorithms and Computation, ISAAC 2011 - Yokohama, Japan
Duration: 5 Dec 20118 Dec 2011

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume7074 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349


Conference22nd International Symposium on Algorithms and Computation, ISAAC 2011


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

Cite this