English

Space-efficient Data Structure for Next/Previous Larger/Smaller Value Queries

Data Structures and Algorithms 2025-06-05 v2

Abstract

Given an array of size nn from a total order, we consider the problem of constructing a data structure that supports various queries (range minimum/maximum queries with their variants and next/previous larger/smaller queries) efficiently. In the encoding model (i.e., the queries can be answered without the input array), we propose a (3.701n+o(n))(3.701n + o(n))-bit data structure, which supports all these queries in O(log()n)O(\log^{(\ell)}n) time, for any positive constant integer \ell (here, log(1)n=logn\log^{(1)} n = \log n, and for >1\ell > 1, log()n=log(log(1)n)\log^{(\ell)} n = \log ({\log^{(\ell-1)}} n)). The space of our data structure matches the current best upper bound of Tsur (Inf. Process. Lett., 2019), which does not support the queries efficiently. Also, we show that at least 3.16nΘ(logn)3.16n-\Theta(\log n) bits are necessary for answering all the queries. Our result is obtained by generalizing Gawrychowski and Nicholson's (3nΘ(logn))(3n - \Theta(\log n))-bit lower bound (ICALP, 15) for answering range minimum and maximum queries on a permutation of size nn.

Keywords

Cite

@article{arxiv.2209.00158,
  title  = {Space-efficient Data Structure for Next/Previous Larger/Smaller Value Queries},
  author = {Seungbum Jo and Geunho Kim},
  journal= {arXiv preprint arXiv:2209.00158},
  year   = {2025}
}

Comments

Fix minor issues in the tables of the journal version

R2 v1 2026-06-28T00:31:52.817Z