English

Text Indexing and Searching in Sublinear Time

Data Structures and Algorithms 2019-07-16 v3

Abstract

We introduce the first index that can be built in o(n)o(n) time for a text of length nn, and can also be queried in o(q)o(q) time for a pattern of length qq. On an alphabet of size σ\sigma, our index uses O(nlognlogσ)O(n\sqrt{\log n\log\sigma}) bits, is built in O(n((loglogn)2+logσ)/logσn)O(n((\log\log n)^2+\sqrt{\log\sigma})/\sqrt{\log_\sigma n}) deterministic time, and computes the number occ\mathrm{occ} of occurrences of the pattern in time O(q/logσn+logn)O(q/\log_\sigma n+\log n). Each such occurrence can then be found in O(lognlogσ)O(\sqrt{\log n\log\sigma}) time. By slightly increasing the space and construction time, to O(n(lognlogσ+logσlogεn))O(n(\sqrt{\log n\log\sigma}+ \log\sigma\log^\varepsilon n)) and O(nlog3/2σ/log1/2εn)O(n\log^{3/2}\sigma/\log^{1/2-\varepsilon} n), respectively, for any constant 0<ε<1/20<\varepsilon<1/2, we can find the occ\mathrm{occ} pattern occurrences in time O(q/logσn+logσnloglogn+occ)O(q/\log_\sigma n + \sqrt{\log_\sigma n}\log\log n + \mathrm{occ}). We build on a novel text sampling based on difference covers, which enjoys properties that allow us efficiently computing longest common prefixes in constant time. We extend our results to the secondary memory model as well, where we give the first construction in o(Sort(n))o(\mathit{Sort}(n)) I/Os of a data structure with suffix array functionality; this data structure supports pattern matching queries with optimal or nearly-optimal cost.

Keywords

Cite

@article{arxiv.1712.07431,
  title  = {Text Indexing and Searching in Sublinear Time},
  author = {J. Ian Munro and Gonzalo Navarro and Yakov Nekrich},
  journal= {arXiv preprint arXiv:1712.07431},
  year   = {2019}
}
R2 v1 2026-06-22T23:24:26.189Z