Range LCP

  • Authors:
  • Amihood Amir;Alberto Apostolico;Gad M. Landau;Avivit Levy;Moshe Lewenstein;Ely Porat

  • Affiliations:
  • Department of Computer Science, Bar-Ilan University, Ramat-Gan, Israel;College of Computing, Georgia Institute of Technology, Atlanta, GA;Department of Computer Science, University of Haifa, Mount Carmel, Haifa, Israel;Department of Software Engineering, Shenkar College, Ramat-Gan, Israel;Department of Computer Science, Bar-Ilan University, Ramat-Gan, Israel;Department of Computer Science, Bar-Ilan University, Ramat-Gan, Israel

  • Venue:
  • ISAAC'11 Proceedings of the 22nd international conference on Algorithms and Computation
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

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, 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. 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|loglogn). 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. Preprocessing Time:O(|S|log2 |S|), Space:O(|S|log1+ε |S|) for arbitrary small constant ε, Query Time:O(loglog|S|).