arXiv · 2610.38327
Optimal Encodings for Next/Previous Larger/Smaller Value Queries: A Unified Approach
Abstract
Given a 1D array over a total order and a query position in the array, a next larger value query returns the nearest position to the right whose value is larger than the value at the query position. Next smaller value queries and previous larger/smaller value queries are defined analogously. These queries are closely related to the $k$-th range minimum/maximum problem, which asks for the position of the $k$-th leftmost minimum/maximum value when the query range contains multiple minimum/maximum values. In this paper, we consider the encoding problem for answering any arbitrary subfamily of these four queries, where the queries must be answered without accessing the input array. We give a unified approach for obtaining space lower bounds for such encodings. We also obtain data structures for the query subfamilies that match the lower bounds up to lower-order additive terms, while supporting the queries in constant time. Our results generalize and improve several previous results on this problem [Gawrychowski and Nicholson, ICALP-2015; Jo and Satti, TCS-2016; Tsur, IPL-2019; Jo and Kim, Algorithmica-2025]. In addition, these results give tight bounds on the encoding complexity of all subfamilies of these queries for (1) permutations, (2) arrays without consecutive equal elements, and (3) general arrays.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Seungbum Jo, Geunho Kim, Kunihiko Sadakane, Srinivasa Rao Satti. 2026-10-28. Optimal Encodings for Next/Previous Larger/Smaller Value Queries: A Unified Approach. https://arxiv.org/abs/2610.38327
Cite the original work for its findings. Save a collection to share your selection of sources.