Order-Preserving Squares in Strings
arXiv:2302.00724
Abstract
An order-preserving square in a string is a fragment of the form where and is order-isomorphic to . We show that a string of length over an alphabet of size contains order-preserving squares that are distinct as words. This improves the upper bound of by Kociumaka, Radoszewski, Rytter, and Waleń [TCS 2016]. Further, for every and we exhibit a string with order-preserving squares that are distinct as words, thus establishing that our upper bound is asymptotically tight. Finally, we design an 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.