Abstract

Let \(\mathsf {T}[1,n]\) be a text of length n and \(\mathsf {T}[i,n]\) be the suffix starting at position i. Also, for any two strings X and Y, let \(\mathsf {LCP}(X, Y)\) denote their longest common prefix. The range-LCP of \(\mathsf {T}\) w.r.t. a range \([\alpha ,\beta ]\), where \(1\le \alpha < \beta \le n\) is Open image in new window Amir et al. [ISAAC 2011] introduced the indexing version of this problem, where the task is to build a data structure over \(\mathsf {T}\), so that \(\mathsf {rlcp}(\alpha ,\beta )\) for any query range \([\alpha ,\beta ]\) can be reported efficiently. They proposed an \(O(n\log ^{1+\epsilon } n)\) space structure with query time \(O(\log \log n)\), and a linear space (i.e., O(n) words) structure with query time \(O(\delta \log \log n)\), where \(\delta = \beta -\alpha +1\) is the length of the input range and \(\epsilon > 0\) is an arbitrarily small constant. Later, Patil et al. [SPIRE 2013] proposed another linear space structure with an improved query time of \(O(\sqrt{\delta }\log ^{\epsilon } \delta )\). This poses an interesting question, whether it is possible to answer \(\mathsf {rlcp}(\cdot ,\cdot )\) queries in poly-logarithmic time using a linear space data structure. In this paper, we settle this question by presenting an O(n) space data structure with query time \(O(\log ^{1+\epsilon } n)\) and construction time \(O(n\log n)\).

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call