# Optimal Query Time for Encoding Range Majority

**Authors:** Pawel Gawrychowski, Patrick K. Nicholson

arXiv: 1704.06149 · 2017-04-21

## TL;DR

This paper introduces a space-efficient data structure that answers range $	au$-majority queries in optimal time, improving previous solutions by balancing space and query efficiency.

## Contribution

The authors present a data structure that achieves optimal query time and space bounds for the range $	au$-majority problem, closing previous gaps in the literature.

## Key findings

- Achieves $O(n \\lg (1/\tau))$ bits of space.
- Supports $O(1/\tau)$ query time.
- Proves space bound optimality even for simpler queries.

## Abstract

We revisit the range $\tau$-majority problem, which asks us to preprocess an array $A[1..n]$ for a fixed value of $\tau \in (0,1/2]$, such that for any query range $[i,j]$ we can return a position in $A$ of each distinct $\tau$-majority element. A $\tau$-majority element is one that has relative frequency at least $\tau$ in the range $[i,j]$: i.e., frequency at least $\tau (j-i+1)$. Belazzougui et al. [WADS 2013] presented a data structure that can answer such queries in $O(1/\tau)$ time, which is optimal, but the space can be as much as $\Theta(n \lg n)$ bits. Recently, Navarro and Thankachan [Algorithmica 2016] showed that this problem could be solved using an $O(n \lg (1/\tau))$ bit encoding, which is optimal in terms of space, but has suboptimal query time. In this paper, we close this gap and present a data structure that occupies $O(n \lg (1/\tau))$ bits of space, and has $O(1/\tau)$ query time. We also show that this space bound is optimal, even for the much weaker query in which we must decide whether the query range contains at least one $\tau$-majority element.

## Full text

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

## Figures

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

## References

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

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