English

Optimal Query Time for Encoding Range Majority

Data Structures and Algorithms 2017-04-21 v1

Abstract

We revisit the range τ\tau-majority problem, which asks us to preprocess an array A[1..n]A[1..n] for a fixed value of τ(0,1/2]\tau \in (0,1/2], such that for any query range [i,j][i,j] we can return a position in AA 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,j]: i.e., frequency at least τ(ji+1)\tau (j-i+1). Belazzougui et al. [WADS 2013] presented a data structure that can answer such queries in O(1/τ)O(1/\tau) time, which is optimal, but the space can be as much as Θ(nlgn)\Theta(n \lg n) bits. Recently, Navarro and Thankachan [Algorithmica 2016] showed that this problem could be solved using an O(nlg(1/τ))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(nlg(1/τ))O(n \lg (1/\tau)) bits of space, and has O(1/τ)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.

Keywords

Cite

@article{arxiv.1704.06149,
  title  = {Optimal Query Time for Encoding Range Majority},
  author = {Pawel Gawrychowski and Patrick K. Nicholson},
  journal= {arXiv preprint arXiv:1704.06149},
  year   = {2017}
}

Comments

To appear in WADS 2017 (modulo the appendix)