Range Majorities and Minorities in Arrays
Abstract
Karpinski and Nekrich (2008) introduced the problem of parameterized range majority, which asks us to preprocess a string of length 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 . Subsequent authors have reduced their time and space bounds such that, when is fixed at preprocessing time, we need either space and optimal query time or linear space and query time, where is the alphabet size. In this paper we give the first linear-space solution with optimal query time, even with variable (i.e., specified with the query). For the case when 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 . 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 query time with variable .
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