English

Longest Common Extensions with Recompression

Data Structures and Algorithms 2016-11-22 v2

Abstract

Given two positions ii and jj in a string TT of length NN, a longest common extension (LCE) query asks for the length of the longest common prefix between suffixes beginning at ii and jj. A compressed LCE data structure is a data structure that stores TT in a compressed form while supporting fast LCE queries. In this article we show that the recompression technique is a powerful tool for compressed LCE data structures. We present a new compressed LCE data structure of size O(zlg(N/z))O(z \lg (N/z)) that supports LCE queries in O(lgN)O(\lg N) time, where zz is the size of Lempel-Ziv 77 factorization without self-reference of TT. Given TT as an uncompressed form, we show how to build our data structure in O(N)O(N) time and space. Given TT as a grammar compressed form, i.e., an straight-line program of size n generating TT, we show how to build our data structure in O(nlg(N/n))O(n \lg (N/n)) time and O(n+zlg(N/z))O(n + z \lg (N/z)) space. Our algorithms are deterministic and always return correct answers.

Keywords

Cite

@article{arxiv.1611.05359,
  title  = {Longest Common Extensions with Recompression},
  author = {Tomohiro I},
  journal= {arXiv preprint arXiv:1611.05359},
  year   = {2016}
}
R2 v1 2026-06-22T16:54:34.271Z