Linear-Space Data Structures for Range Mode Query in Arrays

A mode of a multiset S is an element a ∈ S of maximum multiplicity; that is, a occurs at least as frequently as any other element in S . Given an array A [1: n ] of n elements, we consider a basic problem: constructing a static data structure that efficiently answers range mode queries on A . Each q...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Theory of computing systems 2014-11, Vol.55 (4), p.719-741
Hauptverfasser: Chan, Timothy M., Durocher, Stephane, Larsen, Kasper Green, Morrison, Jason, Wilkinson, Bryan T.
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:A mode of a multiset S is an element a ∈ S of maximum multiplicity; that is, a occurs at least as frequently as any other element in S . Given an array A [1: n ] of n elements, we consider a basic problem: constructing a static data structure that efficiently answers range mode queries on A . Each query consists of an input pair of indices ( i , j ) for which a mode of A [ i : j ] must be returned. The best previous data structure with linear space, by Krizanc, Morin, and Smid (Proceedings of the International Symposium on Algorithms and Computation (ISAAC), pp. 517–526, 2003 ), requires query time in the worst case. We improve their result and present an O ( n )-space data structure that supports range mode queries in worst-case time. In the external memory model, we give a linear-space data structure that requires I/Os per query, where B denotes the block size. Furthermore, we present strong evidence that a query time significantly below cannot be achieved by purely combinatorial techniques; we show that boolean matrix multiplication of two matrices reduces to n range mode queries in an array of size O ( n ). Additionally, we give linear-space data structures for the dynamic problem (queries and updates in near O ( n 3/4 ) time), for orthogonal range mode in d dimensions (queries in near O ( n 1−1/2 d ) time) and for half-space range mode in d dimensions (queries in time). Finally, we complement our dynamic data structure with a reduction from the multiphase problem , again supporting that we cannot hope for much more efficient data structures.
ISSN:1432-4350
1433-0490
DOI:10.1007/s00224-013-9455-2