Order-Preserving Squares in Strings

Samah Ghazawi, Gad M. Landau, Paweł Gawrychowski

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

An order-preserving square in a string is a fragment of the form uv where u ≠ v and u is order-isomorphic to v. We show that a string w of length n over an alphabet of size σ contains O(σn) order-preserving squares that are distinct as words. This improves the upper bound of O(σ2n) by Kociumaka, Radoszewski, Rytter, and Waleń [TCS 2016]. Further, for every σ and n we exhibit a string with Ω(σn) order-preserving squares that are distinct as words, thus establishing that our upper bound is asymptotically tight. Finally, we design an O(σn) time algorithm that outputs all order-preserving squares that occur in a given string and are distinct as words. By our lower bound, this is optimal in the worst case.

Original languageEnglish
Title of host publication34th Annual Symposium on Combinatorial Pattern Matching, CPM 2023
EditorsLaurent Bulteau, Zsuzsanna Liptak
PublisherSchloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
ISBN (Electronic)9783959772761
DOIs
StatePublished - Jun 2023
Event34th Annual Symposium on Combinatorial Pattern Matching, CPM 2023 - Marne-la-Vallee, France
Duration: 26 Jun 202328 Jun 2023

Publication series

NameLeibniz International Proceedings in Informatics, LIPIcs
Volume259
ISSN (Print)1868-8969

Conference

Conference34th Annual Symposium on Combinatorial Pattern Matching, CPM 2023
Country/TerritoryFrance
CityMarne-la-Vallee
Period26/06/2328/06/23

Bibliographical note

Funding Information:
Funding Samah Ghazawi: partially supported by the Israel Science Foundation grant 1475/18, and Grant No. 2018141 from the United States-Israel Binational Science Foundation (BSF). Gad M. Landau: partially supported by the Israel Science Foundation grant 1475/18, and Grant No. 2018141 from the United States-Israel Binational Science Foundation (BSF).

Publisher Copyright:
© 2023 Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing. All rights reserved.

Keywords

  • distinct squares
  • order-isomorphism
  • repetitions

ASJC Scopus subject areas

  • Software

Cite this