关键词:
Range query
Heavy path decomposition
Suffix tree
摘要:
Let T[1, n] be a text of length n and T[i, n] be the suffix starting at position i. Also, for any two strings X and Y, let LCP(X, Y) denote their longest common prefix. The range-LCP of T w.r.t. a range [alpha, beta], where 1 <= alpha < beta <= n is rlcP(alpha, beta) = max{vertical bar LCP(T[i, n], T[j, n])vertical bar vertical bar i not equal j and i, j is an element of [alpha,beta]} Amir et al. [2] introduced the indexing version of this problem, where the task is to build a data structure over T, so that rlcp(alpha, beta) for any query range [alpha, beta] can be reported efficiently. They proposed an 0 (nlog(1+is an element of) n) space structure with query time 0 (log log n), and a linear space (i.e., 0 (n) words) structure with query time 0 (delta loglogn), where delta = beta - alpha +1 is the length of the input range and is an element of > 0 is an arbitrarily small constant. Later, Patil et al. [5] proposed another linear space structure with an improved query time of 0 root delta(log(is an element of) delta). This poses an interesting question, whether it is possible to answer rlcp(., .) queries in poly-logarithmic time using a linear space data structure. In this paper, we settle this question by presenting an 0 (n) space data structure with query time 0 (log(1+is an element of) n) and construction time 0 (n log n). (C) 2020 Elsevier B.V. All rights reserved.