Optimal Encodings for Range Majority Queries

Abstract

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

0

Turn this paper into a lesson

ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…