






















An order-preserving square in a string is a fragment of the form $uv$ where $u\neq v$ and $u$ is order-isomorphic to $v$. We show that a string $w$ of length $n$ over an alphabet of size $σ$ contains $\mathcal{O}(σn)$ order-preserving squares that are distinct as words. This improves the upper bound of $\mathcal{O}(σ^{2}n)$ 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 $\mathcal{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.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。