English

Range Majorities and Minorities in Arrays

Data Structures and Algorithms 2016-06-15 v1

Abstract

Karpinski and Nekrich (2008) introduced the problem of parameterized range majority, which asks us to preprocess a string of length nn such that, given the endpoints of a range, one can quickly find all the distinct elements whose relative frequencies in that range are more than a threshold τ\tau. Subsequent authors have reduced their time and space bounds such that, when τ\tau is fixed at preprocessing time, we need either O(nlog(1/τ))O(n \log (1 / \tau)) space and optimal O(1/τ)O(1 / \tau) query time or linear space and O((1/τ)loglogσ)O((1 / \tau) \log \log \sigma) query time, where σ\sigma is the alphabet size. In this paper we give the first linear-space solution with optimal O(1/τ)O(1 / \tau) query time, even with variable τ\tau (i.e., specified with the query). For the case when σ\sigma is polynomial on the computer word size, our space is optimally compressed according to the symbol frequencies in the string. Otherwise, either the compressed space is increased by an arbitrarily small constant factor or the time rises to any function in (1/τ)ω(1)(1/\tau)\cdot\omega(1). We obtain the same results on the complementary problem of parameterized range minority introduced by Chan et al. (2015), who had achieved linear space and O(1/τ)O(1 / \tau) query time with variable τ\tau.

Keywords

Cite

@article{arxiv.1606.04495,
  title  = {Range Majorities and Minorities in Arrays},
  author = {Djamal Belazzougui and Travis Gagie and J. Ian Munro and Gonzalo Navarro and Yakov Nekrich},
  journal= {arXiv preprint arXiv:1606.04495},
  year   = {2016}
}

Comments

arXiv admin note: substantial text overlap with arXiv:1210.1765

R2 v1 2026-06-22T14:25:19.039Z