Abstract
In Cartesian tree matching, two strings match if the Cartesian trees of the strings are the same. In this paper we define full, initial, and general periods in Cartesian tree matching, and present an O(n) time algorithm for finding all full periods, an \(O(n \log \log n)\) time algorithm for finding all initial periods, and an \(O(n \log n)\) time algorithm for finding all general periods of a string of length n.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Akutsu, T.: Approximate string matching with don’t care characters. Inf. Process. Lett. 55(5), 235–239 (1995). https://doi.org/10.1016/0020-0190(95)00111-O
Amir, A., Apostolico, A., Hirst, T., Landau, G.M., Lewenstein, N., Rozenberg, L.: Algorithms for jumbled indexing, jumbled border and jumbled square on run-length encoded strings. Theoret. Comput. Sci. 656, 146–159 (2016). https://doi.org/10.1016/j.tcs.2016.04.030
Amir, A., Aumann, Y., Landau, G.M., Lewenstein, M., Lewenstein, N.: Pattern matching with swaps. J. Algorithms 37(2), 247–266 (2000). https://doi.org/10.1006/jagm.2000.1120
Amir, A., Farach, M., Muthukrishnan, S.: Alphabet dependence in parameterized matching. Inf. Process. Lett. 49(3), 111–115 (1994). https://doi.org/10.1016/0020-0190(94)90086-8
Amir, A., Lewenstein, M., Porat, E.: Approximate swapped matching. Inf. Process. Lett. 83(1), 33–39 (2002). https://doi.org/10.1016/S0020-0190(01)00302-7
Apostolico, A., Erdos, P.L., Lewenstein, M.: Parameterized matching with mismatches. J. Discrete Algorithms 5(1), 135–140 (2007). https://doi.org/10.1016/j.jda.2006.03.014
Baker, B.S.: A theory of parameterized pattern matching: algorithms and applications. In: STOC, pp. 71–80 (1993). https://doi.org/10.1145/167088.167115
Bland, W., Kucherov, G., Smyth, W.F.: Prefix table construction and conversion. In: Lecroq, T., Mouchard, L. (eds.) IWOCA 2013. LNCS, vol. 8288, pp. 41–53. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-45278-9_5
Burcsi, P., Cicalese, F., Fici, G., Liptak, Z.: Algorithms for jumbled pattern matching in strings. Int. J. Found. Comput. Sci. 23(2), 357–374 (2012). https://doi.org/10.1142/S0129054112400175
Burcsi, P., Cicalese, F., Fici, G., Liptak, Z.: On approximate jumbled pattern matching in strings. Theory Comput. Syst. 50(1), 35–51 (2012). https://doi.org/10.1007/s00224-011-9344-5
Chhabra, T., Giaquinta, E., Tarhio, J.: Filtration algorithms for approximate order-preserving matching. In: Iliopoulos, C., Puglisi, S., Yilmaz, E. (eds.) SPIRE 2015. LNCS, vol. 9309, pp. 177–187. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-23826-5_18
Cole, R., Gottlieb, L.A., Lewenstein, M.: Dictionary matching and indexing with errors and don’t cares. In: STOC, pp. 91–100 (2004). https://doi.org/10.1145/1007352.1007374
Crochemore, M., et al.: Order-preserving indexing. Theoret. Comput. Sci. 638, 122–135 (2016). https://doi.org/10.1016/j.tcs.2015.06.050
Crochemore, M., et al.: A note on efficient computation of all Abelian periods in a string. Inf. Process. Lett. 113(3), 74–77 (2013). https://doi.org/10.1016/j.ipl.2012.11.001
Fischer, M.J., Paterson, M.S.: String-matching and other products. Technical report, MIT Cambridge Project MAC (1974)
Gabow, H.N., Bentley, J.L., Tarjan, R.E.: Scaling and related techniques for geometry problems. In: STOC, pp. 135–143 (1984). https://doi.org/10.1145/800057.808675
Gourdel, G., Kociumaka, T., Radoszewski, J., Rytter, W., Shur, A.M., Walen, T.: String periods in the order-preserving model. In: STACS, pp. 38:1–38:16 (2018). https://doi.org/10.4230/LIPIcs.STACS.2018.38
Iliopoulos, C.S., Rahman, M.S.: A new model to solve the swap matching problem and efficient algorithms for short patterns. In: Geffert, V., Karhumäki, J., Bertoni, A., Preneel, B., Návrat, P., Bieliková, M. (eds.) SOFSEM 2008. LNCS, vol. 4910, pp. 316–327. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-77566-9_27
Kalai, A.: Efficient pattern-matching with don’t cares. In: SODA, pp. 655–656 (2002)
Kim, J., Amir, A., Na, J.C., Park, K., Sim, J.S.: On representations of ternary order relations in numeric strings. Math. Comput. Sci. 11(2), 127–136 (2017). https://doi.org/10.1007/s11786-016-0282-0
Kim, J., et al.: Order-preserving matching. Theoret. Comput. Sci. 525, 68–79 (2014). https://doi.org/10.1016/j.tcs.2013.10.006
Knuth, D.E., Morris, J.H., Pratt, V.R.: Fast pattern matching in strings. SIAM J. Comput. 6(2), 323–350 (1977). https://doi.org/10.1137/0206024
Kociumaka, T., Radoszewski, J., Rytter, W.: Fast algorithms for Abelian periods in words and greatest common divisor queries. J. Comput. Syst. Sci. 84, 205–218 (2017). https://doi.org/10.1016/j.jcss.2016.09.003
Kubica, M., Kulczynski, T., Radoszewski, J., Rytter, W., Walen, T.: A linear time algorithm for consecutive permutation pattern matching. Inf. Process. Lett. 113(12), 430–433 (2013). https://doi.org/10.1016/j.ipl.2013.03.015
Matsuoka, Y., Aoki, T., Inenaga, S., Bannai, H., Takeda, M.: Generalized pattern matching and periodicity under substring consistent equivalence relations. Theoret. Comput. Sci. 656, 225–233 (2016). https://doi.org/10.1016/j.tcs.2016.02.017
Park, S.G., Amir, A., Landau, G.M., Park, K.: Cartesian tree matching and indexing. Accepted to CPM (2019). https://arxiv.org/abs/1905.08974
Sorenson, J.: An introduction to prime number sieves. Technical report, Department of Computer Sciences, University of Wisconsin-Madison (1990)
Stoye, J., Gusfield, D.: Simple and flexible detection of contiguous repeats using a suffix tree. Theoret. Comput. Sci. 270(1), 843–856 (2002). https://doi.org/10.1007/bfb0030787
Vuillemin, J.: A unifying look at data structures. Commun. ACM 23(4), 229–239 (1980). https://doi.org/10.1145/358841.358852
Acknowledgements
M. Bataa, S.G. Park and K. Park were supported by Institute for Information & communications Technology Promotion(IITP) grant funded by the Korea government(MSIT) (No. 2018-0-00551, Framework of Practical Algorithms for NP-hard Graph Problems). A. Amir and G.M. Landau were partially supported by the Israel Science Foundation grant 571/14, and Grant No. 2014028 from the United States-Israel Binational Science Foundation (BSF).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Bataa, M., Park, S.G., Amir, A., Landau, G.M., Park, K. (2019). Finding Periods in Cartesian Tree Matching. In: Colbourn, C., Grossi, R., Pisanti, N. (eds) Combinatorial Algorithms. IWOCA 2019. Lecture Notes in Computer Science(), vol 11638. Springer, Cham. https://doi.org/10.1007/978-3-030-25005-8_7
Download citation
DOI: https://doi.org/10.1007/978-3-030-25005-8_7
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-25004-1
Online ISBN: 978-3-030-25005-8
eBook Packages: Computer ScienceComputer Science (R0)