Skip to main content
Log in

On Cartesian Trees and Range Minimum Queries

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

We present new results on Cartesian trees with applications in range minimum queries and bottleneck edge queries. We introduce a cache-oblivious Cartesian tree for solving the range minimum query problem, a Cartesian tree for the bottleneck edge query problem on trees and undirected graphs, and a proof that no Cartesian tree exists for the two-dimensional version of the range minimum query problem.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1

Similar content being viewed by others

Notes

  1. Two RMQ arrays are different if their range minimum is in different locations for some range.

  2. We follow Seidel [34]. The function α(⋅) is usually defined slightly differently, but all variants are equivalent up to an additive constant.

  3. log∗∗ n is the number of times log function is applied to n to produce a constant, \(\alpha_{k}(n)=\log^{\overbrace{**\cdots*}^{k \mathrm{times}}}n\) and the inverse Ackerman function α(n) is the smallest k such that α k (n) is a constant.

  4. Since the (unknown) B can be greater than the length of S we don’t really scan S for s 2 times. Instead, we scan once a sequence of s copies of S.

  5. This sorting is in the most general comparison model. With integer weights one can use faster sorting algorithms such as Fusion trees [19] in O(lgn) time.

  6. Two matrices are different if their range minima are in different locations for some rectangular range.

References

  1. Agarwal, P.K., Arge, L., Danner, A., Holland-Minkley, B.: Cache-oblivious data structures for orthogonal range searching. In: Proceedings of the 19th Annual ACM Symposium on Computational Geometry (SCG), pp. 237–245 (2003)

    Google Scholar 

  2. Aggarwal, A., Vitter, J.S.: The input/output complexity of sorting and related problems. Commun. ACM 31(9), 1116–1127 (1988)

    Article  MathSciNet  Google Scholar 

  3. Alon, N., Schieber, B.: Optimal preprocessing for answering on-line product queries. Technical report, TR-71/87, Institute of Computer Science, Tel Aviv University (1987)

  4. Alstrup, S., Spork, M.: Optimal on-line decremental connectivity in trees. Inf. Process. Lett. 64(4), 161–164 (1997)

    Article  MathSciNet  Google Scholar 

  5. Amir, A., Fischer, J., Lewenstein, M.: Two-dimensional range minimum queries. In: Proceedings of the 18th Annual Symposium on Combinatorial Pattern Matching (CPM), pp. 286–294 (2007)

    Chapter  Google Scholar 

  6. Arge, L., Bender, M.A., Demaine, E.D., Holland-Minkley, B., Munro, J.I.: An optimal cache-oblivious priority queue and its application to graph algorithms. SIAM J. Comput. 36(6), 1672–1695 (2007)

    Article  MATH  MathSciNet  Google Scholar 

  7. Atallah, M.J., Yuan, H.: Data structures for range minimum queries in multidimensional arrays. In: Proceedings of the 21st Annual Symposium on Discrete Algorithms (SODA), pp. 150–160 (2010)

    Google Scholar 

  8. Bender, M.A., Demaine, E.D., Farach-colton, M.: Cache-oblivious B-trees. SIAM J. Comput. 399–409 (2000)

  9. Bender, M.A., Farach-Colton, M., Pemmasani, G., Skiena, S., Sumazin, P.: Lowest common ancestors in trees and directed acyclic graphs. J. Algorithms 57(2), 75–94 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  10. Berkman, O., Vishkin, U.: Recursive star-tree parallel data structure. SIAM J. Comput. 22(2), 221–242 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  11. Brodal, G.S., Fagerberg, R.: Cache-oblivious string dictionaries. In: Proceedings of the 17th Annual Symp. on Discrete Algorithms (SODA), pp. 581–590 (2006)

    Google Scholar 

  12. Chazelle, B.: A minimum spanning tree algorithm with inverse-Ackermann type complexity. J. ACM 47(6), 1028–1047 (2000)

    Article  MATH  MathSciNet  Google Scholar 

  13. Chazelle, B., Rosenberg, B.: Computing partial sums in multidimensional arrays. In: Proceedings of the 5th Annual ACM Symposium on Computational Geometry (SCG), pp. 131–139 (1989)

    Google Scholar 

  14. Cole, R., Hariharan, R.: Dynamic LCA queries on trees. In: Proceedings of the 10th Annual Symposium on Discrete Algorithms (SODA), pp. 235–244 (1999)

    Google Scholar 

  15. Demaine, E.D., Landau, G.M., Weimann, O.: On Cartesian trees and range minimum queries. In: Proceedings of the 36th International Colloquium on Automata, Languages and Programming (ICALP), pp. 341–353 (2009)

    Chapter  Google Scholar 

  16. Duan, R., Pettie, S.: Fast algorithms for (max,min)-matrix multiplication and bottleneck shortest paths. In: Proceedings of the 20th Annual Symposium on Discrete Algorithms (SODA), pp. 384–391 (2009)

    Chapter  Google Scholar 

  17. Even, S., Shiloach, Y.: An on-line edge deletion problem. J. ACM 28, 1–4 (1981)

    Article  MATH  MathSciNet  Google Scholar 

  18. Fischer, J., Heun, V.: Theoretical and practical improvements on the RMQ-problem, with applications to LCA and LCE. In: Proceedings of the 17th Symposium on Combinatorial Pattern Matching (CPM), pp. 36–48 (2006)

    Chapter  Google Scholar 

  19. Fredman, M.L., Willard, D.E.: Surpassing the information theoretic bound with fusion trees. J. Comput. Syst. Sci. 47, 424–433 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  20. Frigo, M., Leiserson, C.E., Prokop, H., Ramachandran, S.: Cache-oblivious algorithms. In: Proceedings of the 40th Symposium on Foundations of Computer Science (FOCS), pp. 285–298 (1999)

    Google Scholar 

  21. Gabow, H., Bentley, J.L., Tarjan, R.E.: Scaling and related techniques for geometry problems. In: Proceedings of the 16th Annual ACM Symposium on Theory of Computing (STOC), pp. 135–143 (1984)

    Google Scholar 

  22. Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13(2), 338–355 (1984)

    Article  MATH  MathSciNet  Google Scholar 

  23. Hu, T.C.: The maximum capacity route problem. Oper. Res. 9(6), 898–900 (1961)

    Article  Google Scholar 

  24. Karger, D.R., Klein, P.N., Tarjan, R.E.: A randomized linear-time algorithm for finding minimum spanning trees. J. ACM 42, 321–329 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  25. Katz, M., Katz, N.A., Korman, A., Peleg, D.: Labeling schemes for flow and connectivity. SICOMP: SIAM J. Comput. 34 (2005)

  26. Knuth, D.E.: The Art of Computer Programming Volume 4 Fascicle 4: Generating All Trees; History of Combinatorial Generation. Addison-Wesley, Reading (2006)

    Google Scholar 

  27. Komlós, J.: Linear verification for spanning trees. Combinatorica 5(1), 57–65 (1985)

    Article  MATH  MathSciNet  Google Scholar 

  28. Kopelowitz, T., Lewenstein, M.: Dynamic weighted ancestors. In: Proceedings of the 18th Annual Symposium on Discrete Algorithms (SODA), pp. 565–574 (2007)

    Google Scholar 

  29. Pettie, S.: An inverse-Ackermann style lower bound for the online minimum spanning tree. In: Proceedings of the 43rd Symposium on Foundations of Computer Science (FOCS), pp. 155–163 (2002)

    Google Scholar 

  30. Pettie, S., Ramachandran, V.: Minimizing randomness in minimum spanning tree, parallel connectivity and set maxima algorithms. In: Proceedings of the 13th Annual Symposium on Discrete Algorithms (SODA), pp. 713–722 (2002)

    Google Scholar 

  31. Pettie, S., Ramachandran, V.: An optimal minimum spanning tree algorithm. J. ACM 49(1), 16–34 (2002)

    Article  MathSciNet  Google Scholar 

  32. Pollack, M.: The maximum capacity through a network. Oper. Res. 8(5), 733–736 (1960)

    Article  MathSciNet  Google Scholar 

  33. Schieber, B., Vishkin, U.: On finding lowest common ancestors: simplification and parallelization. SIAM J. Comput. 17, 1253–1262 (1988)

    Article  MATH  MathSciNet  Google Scholar 

  34. Seidel, R.: Understanding the inverse Ackermann function. PDF presenttion. Available at http://cgi.di.uoa.gr/~ewcg06/invited/Seidel.pdf

  35. Shapira, A., Yuster, R., Zwick, U.: All-pairs bottleneck paths in vertex weighted graphs. In: Proceedings of the 18th Annual Symposium on Discrete Algorithms (SODA), pp. 978–985 (2007)

    Google Scholar 

  36. Sleator, D.D., Tarjan, R.E.: A data structure for dynamic trees. J. Comput. Syst. Sci. 26(3), 362–391 (1983)

    Article  MATH  MathSciNet  Google Scholar 

  37. Sleator, D.D., Tarjan, R.E.: Self-adjusting binary trees. In: Proceedings of the 15th Annual ACM Symposium on Theory of Computing (STOC), pp. 235–245 (1983)

    Google Scholar 

  38. Vassilevska, V., Williams, R., Yuster, R.: All-pairs bottleneck paths for general graphs in truly sub-cubic time. In: Proceedings of the 39th Annual ACM Symposium on Theory of Computing (STOC), pp. 585–589 (2007)

    Google Scholar 

Download references

Acknowledgements

G.M. Landau is partially supported by the National Science Foundation Award 0904246, Israel Science Foundation grant 347/09, Yahoo, Grant No. 2008217 from the United States-Israel Binational Science Foundation (BSF) and DFG.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Oren Weimann.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Demaine, E.D., Landau, G.M. & Weimann, O. On Cartesian Trees and Range Minimum Queries. Algorithmica 68, 610–625 (2014). https://doi.org/10.1007/s00453-012-9683-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-012-9683-x

Keywords

Navigation