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.
Similar content being viewed by others
Notes
Two RMQ arrays are different if their range minimum is in different locations for some range.
We follow Seidel [34]. The function α(⋅) is usually defined slightly differently, but all variants are equivalent up to an additive constant.
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.
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.
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.
Two matrices are different if their range minima are in different locations for some rectangular range.
References
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)
Aggarwal, A., Vitter, J.S.: The input/output complexity of sorting and related problems. Commun. ACM 31(9), 1116–1127 (1988)
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)
Alstrup, S., Spork, M.: Optimal on-line decremental connectivity in trees. Inf. Process. Lett. 64(4), 161–164 (1997)
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)
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)
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)
Bender, M.A., Demaine, E.D., Farach-colton, M.: Cache-oblivious B-trees. SIAM J. Comput. 399–409 (2000)
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)
Berkman, O., Vishkin, U.: Recursive star-tree parallel data structure. SIAM J. Comput. 22(2), 221–242 (1993)
Brodal, G.S., Fagerberg, R.: Cache-oblivious string dictionaries. In: Proceedings of the 17th Annual Symp. on Discrete Algorithms (SODA), pp. 581–590 (2006)
Chazelle, B.: A minimum spanning tree algorithm with inverse-Ackermann type complexity. J. ACM 47(6), 1028–1047 (2000)
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)
Cole, R., Hariharan, R.: Dynamic LCA queries on trees. In: Proceedings of the 10th Annual Symposium on Discrete Algorithms (SODA), pp. 235–244 (1999)
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)
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)
Even, S., Shiloach, Y.: An on-line edge deletion problem. J. ACM 28, 1–4 (1981)
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)
Fredman, M.L., Willard, D.E.: Surpassing the information theoretic bound with fusion trees. J. Comput. Syst. Sci. 47, 424–433 (1993)
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)
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)
Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13(2), 338–355 (1984)
Hu, T.C.: The maximum capacity route problem. Oper. Res. 9(6), 898–900 (1961)
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)
Katz, M., Katz, N.A., Korman, A., Peleg, D.: Labeling schemes for flow and connectivity. SICOMP: SIAM J. Comput. 34 (2005)
Knuth, D.E.: The Art of Computer Programming Volume 4 Fascicle 4: Generating All Trees; History of Combinatorial Generation. Addison-Wesley, Reading (2006)
Komlós, J.: Linear verification for spanning trees. Combinatorica 5(1), 57–65 (1985)
Kopelowitz, T., Lewenstein, M.: Dynamic weighted ancestors. In: Proceedings of the 18th Annual Symposium on Discrete Algorithms (SODA), pp. 565–574 (2007)
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)
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)
Pettie, S., Ramachandran, V.: An optimal minimum spanning tree algorithm. J. ACM 49(1), 16–34 (2002)
Pollack, M.: The maximum capacity through a network. Oper. Res. 8(5), 733–736 (1960)
Schieber, B., Vishkin, U.: On finding lowest common ancestors: simplification and parallelization. SIAM J. Comput. 17, 1253–1262 (1988)
Seidel, R.: Understanding the inverse Ackermann function. PDF presenttion. Available at http://cgi.di.uoa.gr/~ewcg06/invited/Seidel.pdf
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)
Sleator, D.D., Tarjan, R.E.: A data structure for dynamic trees. J. Comput. Syst. Sci. 26(3), 362–391 (1983)
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)
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)
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
Corresponding author
Rights 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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453-012-9683-x