Finding Periods in Cartesian Tree Matching

  • Conference paper
  • First Online:
Combinatorial Algorithms (IWOCA 2019)

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

Included in the following conference series:

  • 678 Accesses

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.

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

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. 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

    Article  MathSciNet  Google Scholar 

  2. 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

    Article  MathSciNet  Google Scholar 

  3. 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

    Article  MathSciNet  Google Scholar 

  4. 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

    Article  Google Scholar 

  5. 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

    Article  MathSciNet  Google Scholar 

  6. 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

    Article  MathSciNet  Google Scholar 

  7. 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

  8. 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

    Chapter  Google Scholar 

  9. 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

    Article  MathSciNet  Google Scholar 

  10. 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

    Article  MathSciNet  Google Scholar 

  11. 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

    Chapter  Google Scholar 

  12. 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

  13. Crochemore, M., et al.: Order-preserving indexing. Theoret. Comput. Sci. 638, 122–135 (2016). https://doi.org/10.1016/j.tcs.2015.06.050

    Article  MathSciNet  Google Scholar 

  14. 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

    Article  MathSciNet  Google Scholar 

  15. Fischer, M.J., Paterson, M.S.: String-matching and other products. Technical report, MIT Cambridge Project MAC (1974)

    Google Scholar 

  16. 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

  17. 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

  18. 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

    Chapter  Google Scholar 

  19. Kalai, A.: Efficient pattern-matching with don’t cares. In: SODA, pp. 655–656 (2002)

    Google Scholar 

  20. 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

    Article  MathSciNet  Google Scholar 

  21. Kim, J., et al.: Order-preserving matching. Theoret. Comput. Sci. 525, 68–79 (2014). https://doi.org/10.1016/j.tcs.2013.10.006

    Article  MathSciNet  Google Scholar 

  22. 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

  23. 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

    Article  MathSciNet  Google Scholar 

  24. 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

    Article  MathSciNet  Google Scholar 

  25. 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

    Article  MathSciNet  Google Scholar 

  26. 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

  27. Sorenson, J.: An introduction to prime number sieves. Technical report, Department of Computer Sciences, University of Wisconsin-Madison (1990)

    Google Scholar 

  28. 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

    Chapter  Google Scholar 

  29. Vuillemin, J.: A unifying look at data structures. Commun. ACM 23(4), 229–239 (1980). https://doi.org/10.1145/358841.358852

    Article  MathSciNet  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Kunsoo Park .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics

Navigation