Optimal Query Time for Encoding Range Majority
Abstract
We revisit the range -majority problem, which asks us to preprocess an array for a fixed value of , such that for any query range we can return a position in of each distinct -majority element. A -majority element is one that has relative frequency at least in the range : i.e., frequency at least . Belazzougui et al. [WADS 2013] presented a data structure that can answer such queries in time, which is optimal, but the space can be as much as bits. Recently, Navarro and Thankachan [Algorithmica 2016] showed that this problem could be solved using an 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 bits of space, and has 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 -majority element.
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)