Linear-Space Data Structures for Range Mode Query in Arrays
Abstract
A mode of a multiset is an element of maximum multiplicity; that is, occurs at least as frequently as any other element in . Given a list of items, we consider the problem of constructing a data structure that efficiently answers range mode queries on . Each query consists of an input pair of indices for which a mode of must be returned. We present an -space static data structure that supports range mode queries in time in the worst case, for any fixed . When , this corresponds to the first linear-space data structure to guarantee query time. We then describe three additional linear-space data structures that provide , , and query time, respectively, where denotes the number of distinct elements in and denotes the frequency of the mode of . Finally, we examine generalizing our data structures to higher dimensions.
Keywords
Cite
@article{arxiv.1101.4068,
title = {Linear-Space Data Structures for Range Mode Query in Arrays},
author = {Stephane Durocher and Jason Morrison},
journal= {arXiv preprint arXiv:1101.4068},
year = {2011}
}
Comments
13 pages, 2 figures