Advertisement

Online Sorted Range Reporting

  • Gerth Stølting Brodal
  • Rolf Fagerberg
  • Mark Greve
  • Alejandro López-Ortiz
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5878)

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.

Keywords

Small Element Query Range Lower Common Ancestor Complete Binary Tree Lower Common Ancestor 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Page, L., Brin, S., Motwani, R., Winograd, T.: The PageRank citation ranking: Bringing order to the web. Technical Report 1999-66, Stanford InfoLab (1999)Google Scholar
  2. 2.
    Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM Journal on Computing 13(2), 338–355 (1984)MATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    Fredman, M.L., Willard, D.E.: Surpassing the information theoretic bound with fusion trees. J. Comput. Syst. Sci. 47(3), 424–436 (1993)MATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Frederickson, G.N., Johnson, D.B.: The complexity of selection and ranking in X + Y and matrices with sorted columns. J. Comput. Syst. Sci. 24(2), 197–208 (1982)MATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Vuillemin, J.: A unifying look at data structures. CACM 23(4), 229–239 (1980)MATHMathSciNetGoogle Scholar
  6. 6.
    Frederickson, G.N.: An optimal algorithm for selection in a min-heap. Inf. Comput. 104(2), 197–214 (1993)MATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Gerth Stølting Brodal
    • 1
  • Rolf Fagerberg
    • 2
  • Mark Greve
    • 1
  • Alejandro López-Ortiz
    • 3
  1. 1.MADALGO, Dept. of Computer ScienceAarhus UniversityDenmark
  2. 2.Dept. of Math. and Computer ScienceUniversity of Southern Denmark 
  3. 3.School of Computer ScienceUniversity of WaterlooCanada

Personalised recommendations