Order-Preserving Squares in Strings

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\'n [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.

0

Turn this paper into a lesson

ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…