Approximate range mode and range median queries

  • Authors:
  • Prosenjit Bose;Evangelos Kranakis;Pat Morin;Yihui Tang

  • Affiliations:
  • School of Computer Science, Carleton University, Ottawa, Ontario, Canada;School of Computer Science, Carleton University, Ottawa, Ontario, Canada;School of Computer Science, Carleton University, Ottawa, Ontario, Canada;School of Computer Science, Carleton University, Ottawa, Ontario, Canada

  • Venue:
  • STACS'05 Proceedings of the 22nd annual conference on Theoretical Aspects of Computer Science
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

We consider data structures and algorithms for preprocessing a labelled list of length n so that, for any given indices i and j we can answer queries of the form: What is the mode or median label in the sequence of labels between indices i and j. Our results are on approximate versions of this problem. Using $O(\frac{n}{1-\alpha})$ space, our data structure can find in $O({\rm log}{\rm log}_\frac{1}{\alpha} n)$ time an element whose number of occurrences is at least α times that of the mode, for some user-specified parameter 0αα=1/2,1/3 and 1/4, using storage space of O(n log n), O(n log log n) and O(n), respectively. Finally, if the elements are comparable, we construct an $O(\frac{n}{1-\alpha})$ space data structure that answers approximate range median queries. Specifically, given indices i and j, in O(1) time, an element whose rank is at least $\alpha \times \lfloor|j-i+1|/2\rfloor$ and at most $(2-\alpha)\times\lfloor|j-i+1|/2\rfloor$ is returned for 0α