# On Approximate Range Mode and Range Selection

**Authors:** Hicham El-Zein, Meng He, J. Ian Munro, Yakov Nekrich, Bryce Sandlund

arXiv: 1907.08579 · 2019-07-22

## TL;DR

This paper introduces space-efficient data structures for approximate range mode and selection queries, achieving optimal or near-optimal space and supporting dynamic updates and arbitrary rank queries.

## Contribution

It presents the first dynamic data structure for approximate range mode and improves space efficiency for static approximate range selection.

## Key findings

- Supports $(1+\epsilon)$-approximate range mode with optimal space and fast queries.
- Provides a dynamic data structure for approximate range mode with efficient updates.
- Achieves constant-time approximate range selection with optimal space.

## Abstract

For any $\epsilon \in (0,1)$, a $(1+\epsilon)$-approximate range mode query asks for the position of an element whose frequency in the query range is at most a factor $(1+\epsilon)$ smaller than the true mode. For this problem, we design an $O(n/\epsilon)$ bit data structure supporting queries in $O(\lg(1/\epsilon))$ time. This is an encoding data structure which does not require access to the input sequence; we prove the space cost is asymptotically optimal for constant $\epsilon$. Our solution improves the previous best result of Greve et al. (Cell Probe Lower Bounds and Approximations for Range Mode, ICALP'10) by reducing the space cost by a factor of $\lg n$ while achieving the same query time. We also design an $O(n)$-word dynamic data structure that answers queries in $O(\lg n /\lg\lg n)$ time and supports insertions and deletions in $O(\lg n)$ time, for any constant $\epsilon \in (0,1)$. This is the first result on dynamic approximate range mode; it can also be used to obtain the first static data structure for approximate 3-sided range mode queries in two dimensions.   We also consider approximate range selection. For any $\alpha \in (0,1/2)$, an $\alpha$-approximate range selection query asks for the position of an element whose rank in the query range is in $[k - \alpha s, k + \alpha s]$, where $k$ is a rank given by the query and $s$ is the size of the query range. When $\alpha$ is a constant, we design an $O(n)$-bit encoding data structure that can answer queries in constant time and prove this space cost is asymptotically optimal. The previous best result by Krizanc et al. (Range Mode and Range Median Queries on Lists and Trees, Nordic Journal of Computing, 2005) uses $O(n\lg n)$ bits, or $O(n)$ words, to achieve constant approximation for range median only. Thus we not only improve the space cost, but also provide support for any arbitrary $k$ given at query time.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1907.08579/full.md

## Figures

2 figures with captions in the complete paper: https://tomesphere.com/paper/1907.08579/full.md

## References

20 references — full list in the complete paper: https://tomesphere.com/paper/1907.08579/full.md

---
Source: https://tomesphere.com/paper/1907.08579