English

Better Space Bounds for Parameterized Range Majority and Minority

Data Structures and Algorithms 2014-07-15 v2

Abstract

Karpinski and Nekrich (2008) introduced the problem of parameterized range majority, which asks 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 given at preprocessing time, we need either \Ohnlog(1/τ)\Oh{n \log (1 / \tau)} space and optimal \Oh1/τ\Oh{1 / \tau} query time or linear space and \Oh(1/τ)loglogσ\Oh{(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 \Oh1/τ\Oh{1 / \tau} query time. For the case when τ\tau is given at query time, we significantly improve previous bounds, achieving either \Ohnloglogσ\Oh{n \log \log \sigma} space and optimal \Oh1/τ\Oh{1 / \tau} query time or compressed space and \Oh(1/τ)loglog(1/τ)logw\Oh{(1 / \tau) \log \frac{\log (1 / \tau)}{\log w}} query time. Along the way, we consider the complementary problem of parameterized range minority that was recently introduced by Chan et al.\ (2012), who achieved linear space and \Oh1/τ\Oh{1 / \tau} query time even for variable τ\tau. We improve their solution to use either nearly optimally compressed space with no slowdown, or optimally compressed space with nearly no slowdown. Some of our intermediate results, such as density-sensitive query time for one-dimensional range counting, may be of independent interest.

Keywords

Cite

@article{arxiv.1210.1765,
  title  = {Better Space Bounds for Parameterized Range Majority and Minority},
  author = {Djamal Belazzougui and Travis Gagie and Gonzalo Navarro},
  journal= {arXiv preprint arXiv:1210.1765},
  year   = {2014}
}
R2 v1 2026-06-21T22:16:58.874Z