English

Optimal Encodings for Range Majority Queries

Data Structures and Algorithms 2014-10-07 v3

Abstract

We study the problem of designing a data structure that reports the positions of the distinct τ\tau-majorities within any range of an array A[1,n]A[1,n], without storing AA. A τ\tau-majority in a range A[i,j]A[i,j], for 0<τ<10<\tau< 1, is an element that occurs more than τ(ji+1)\tau(j-i+1) times in A[i,j]A[i,j]. We show that Ω(nlog(1/τ))\Omega(n\log(1/\tau)) bits are necessary for any data structure able just to count the number of distinct τ\tau-majorities in any range. Then, we design a structure using O(nlog(1/τ))O(n\log(1/\tau)) bits that returns one position of each τ\tau-majority of A[i,j]A[i,j] in O((1/τ)loglogw(1/τ)logn)O((1/\tau)\log\log_w(1/\tau)\log n) time, on a RAM machine with word size ww (it can output any further position where each τ\tau-majority occurs in O(1)O(1) additional time). Finally, we show how to remove a logn\log n factor from the time by adding O(nloglogn)O(n\log\log n) bits of space to the structure.

Keywords

Cite

@article{arxiv.1404.2677,
  title  = {Optimal Encodings for Range Majority Queries},
  author = {Gonzalo Navarro and Sharma V. Thankachan},
  journal= {arXiv preprint arXiv:1404.2677},
  year   = {2014}
}
R2 v1 2026-06-22T03:47:34.114Z