Skip to main content

Towards Optimal Range Medians

  • Conference paper
Automata, Languages and Programming (ICALP 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5555))

Included in the following conference series:

Abstract

We consider the following problem: given an unsorted array of n elements, and a sequence of intervals in the array, compute the median in each of the subarrays defined by the intervals. We describe a simple algorithm which uses O(n) space and needs O(nlogk + klogn) time to answer k such median queries. This improves previous algorithms by a logarithmic factor and matches a lower bound for k = O(n). Since, in contrast to previous approaches, the algorithm decomposes the range of element values rather than the array, it has natural generalizations to higher-dimensional problems – it reduces a range median query to a logarithmic number of range counting queries.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bender, M.A., Farach-Colton, M.: The Level Ancestor Problem simplified. Theor. Comput. Sci. 321(1), 5–12 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  2. Blum, M., Floyd, R.W., Pratt, V.R., Rivest, R.L., Tarjan, R.E.: Linear Time Bounds for Median Computations. In: 4th Annual Symp. on Theory of Computing (STOC), pp. 119–124 (1972)

    Google Scholar 

  3. Chazelle, B., Guibas, L.J.: Fractional cascading: I. A data structuring technique. Algorithmica 1, 133–162 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  4. Clark, D.R.: Compact Pat Trees. PhD thesis, University of Waterloo (1988)

    Google Scholar 

  5. Cline, D., White, K.B., Egbert, P.K.: Fast 8-bit median filtering based on separability. In: IEEE International Conference on Image Processing (ICIP), vol. 5, pp. 281–284 (2007)

    Google Scholar 

  6. de Berg, M., van Kreveld, M., Overmars, M., Schwarzkopf, O.: Computational Geometry Algorithms and Applications, 2nd edn. Springer, Heidelberg (2000)

    MATH  Google Scholar 

  7. Gfeller, B., Sanders, P.: Towards optimal range medians. CoRR, abs/0901.1761 (2009)

    Google Scholar 

  8. Gil, J., Werman, M.: Computing 2-d min, median, and max filters. IEEE Transactions on Pattern Analysis and Machine Intelligence 15(5), 504–507 (1993)

    Article  Google Scholar 

  9. Har-Peled, S., Muthukrishnan, S.M.: Range Medians. In: Halperin, D., Mehlhorn, K. (eds.) Esa 2008. LNCS, vol. 5193, pp. 503–514. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  10. JáJá, J., Mortensen, C.W., Shi, Q.: Space-efficient and fast algorithms for multidimensional dominance reporting and counting. In: Fleischer, R., Trippen, G. (eds.) ISAAC 2004. LNCS, vol. 3341, pp. 558–568. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  11. Krizanc, D., Morin, P., Smid, M.H.M.: Range Mode and Range Median Queries on Lists and Trees. Nord. J. Comput. 12(1), 1–17 (2005)

    MathSciNet  MATH  Google Scholar 

  12. Mehlhorn, K.: Data structures and algorithms. Sorting and Searching, vol. 1. Springer, Berlin (1984)

    MATH  Google Scholar 

  13. Nievergelt, J., Reingold, E.M.: Binary Search Trees of Bounded Balance. In: 4th Annual Symp. on Theory of Computing (STOC), pp. 137–142. ACM Press, New York (1972)

    Google Scholar 

  14. Okanohara, D., Sadakane, K.: Practical entropy-compressed rank/select dictionary. The Computing Research Repository (CoRR), abs/cs/0610001 (2006)

    Google Scholar 

  15. Petersen, H.: Improved Bounds for Range Mode and Range Median Queries. In: Geffert, V., Karhumäki, J., Bertoni, A., Preneel, B., Návrat, P., Bieliková, M. (eds.) SOFSEM 2008. LNCS, vol. 4910, pp. 418–423. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  16. Petersen, H., Grabowski, S.: Range mode and range median queries in constant time and sub-quadratic space. Information Processing Letters 109(4), 225–228 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  17. Perreault, S., Hébert, P.: Median filtering in constant time. IEEE Transactions on Image Processing 16(9), 2389–2394 (2007)

    Article  MathSciNet  Google Scholar 

  18. Roura, S.: A New Method for Balancing Binary Search Trees. In: Orejas, F., Spirakis, P.G., van Leeuwen, J. (eds.) ICALP 2001. LNCS, vol. 2076, pp. 469–480. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  19. Varman, P.J., Scheufler, S.D., Iyer, B.R., Ricard, G.R.: Merging multiple lists on hierarchical-memory multiprocessors. J. Parallel Distrib. Comput. 12(2), 171–177 (1991)

    Article  MATH  Google Scholar 

  20. Willard, D.E., Lueker, G.S.: Adding range restriction capability to dynamic data structures. J. ACM 32(3), 597–617 (1985)

    Article  MathSciNet  MATH  Google Scholar 

  21. Yao, A.C.-C.: Space-time tradeoff for answering range queries (extended abstract). In: 14th Annual Symp. on Theory of Computing (STOC), pp. 128–136 (1982)

    Google Scholar 

  22. Yao, A.C.-C.: On the Complexity of Maintaining Partial Sums. SIAM J. Comput. 14(2), 277–288 (1985)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Gfeller, B., Sanders, P. (2009). Towards Optimal Range Medians. In: Albers, S., Marchetti-Spaccamela, A., Matias, Y., Nikoletseas, S., Thomas, W. (eds) Automata, Languages and Programming. ICALP 2009. Lecture Notes in Computer Science, vol 5555. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-02927-1_40

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-02927-1_40

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-02926-4

  • Online ISBN: 978-3-642-02927-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics