Online Sorted Range Reporting

  • Authors:
  • Gerth Stølting Brodal;Rolf Fagerberg;Mark Greve;Alejandro López-Ortiz

  • Affiliations:
  • MADALGO, Dept. of Computer Science, Aarhus University, Denmark;Dept. of Math. and Computer Science, University of Southern Denmark,;MADALGO, Dept. of Computer Science, Aarhus University, Denmark;School of Computer Science, University of Waterloo, Canada

  • Venue:
  • ISAAC '09 Proceedings of the 20th International Symposium on Algorithms and Computation
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

We study the following one-dimensional range reporting problem: On an array A of n elements, support queries that given two indices i ≤ j and an integer k report the k smallest elements in the subarray A[i..j] in sorted order. We present a data structure in the RAM model supporting such queries in optimal O(k) time. The structure uses O(n) words of space and can be constructed in O(n logn) time. The data structure can be extended to solve the online version of the problem, where the elements in A[i..j] are reported one-by-one in sorted order, in O(1) worst-case time per element. The problem is motivated by (and is a generalization of) a problem with applications in search engines: On a tree where leaves have associated rank values, report the highest ranked leaves in a given subtree. Finally, the problem studied generalizes the classic range minimum query (RMQ) problem on arrays.