Abstract
We introduce a new metric of match, called Cartesian tree matching, which means that two strings match if they have the same Cartesian trees. Based on Cartesian tree matching, we define single pattern matching, multiple pattern matching, and indexing problems. We propose a linear time algorithm for single pattern matching, and randomized linear time algorithms for multiple pattern matching and indexing. We also define three types of periods, called full period, initial period, and general period. We propose O(n) time, O(nloglogn) time, and O(nlogn) time algorithms for finding all the full periods, initial periods, and general periods of a string of length n, respectively. Our efficient algorithms use a representation of the Cartesian tree, called parent-distance representation.
Original language | English |
---|---|
Pages (from-to) | 181-197 |
Number of pages | 17 |
Journal | Theoretical Computer Science |
Volume | 845 |
DOIs | |
State | Published - 12 Dec 2020 |
Bibliographical note
Publisher Copyright:© 2020 Elsevier B.V.
Funding
S.G. Park, M. Bataa 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). S.G. Park, M. Bataa 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).
Funders | Funder number |
---|---|
Bloom's Syndrome Foundation | |
United States-Israel Binational Science Foundation | |
Israel Science Foundation | 571/14, 2014028 |
Institute for Information and Communications Technology Promotion | |
Ministry of Science and ICT, South Korea | 2018-0-00551 |
Keywords
- Cartesian tree matching
- Indexing
- Parent-distance representation
- Pattern matching
- Periods