A string is closed if it has length 1 or has a nonempty border without internal occurrences. In this paper we introduce the definition of a maximal closed substring (MCS), which is an occurrence of a closed substring that cannot be extended to the left nor to the right into a longer closed substring. MCSs with exponent at least $2$ are commonly called runs; those with exponent smaller than $2$, instead, are particular cases of maximal gapped repeats. We show that a string of length $n$ contains $\mathcal O(n^{1.5})$ MCSs. We also provide an output-sensitive algorithm that, given a string of length $n$ over a constant-size alphabet, locates all $m$ MCSs the string contains in $\mathcal O(n\log n + m)$ time.
翻译:如果字符串的长度为 1 或没有内部事件的非空边框, 则该字符串将被关闭。 在本文中, 我们引入了最大封闭子字符串的定义( MCS), 这是一种封闭的子字符串, 无法延伸至左侧, 也不能扩展至右侧, 进入一个较长封闭的子字符串 。 挂号至少为$2 的 MCS 通常被称为运行; 挂号小于$2 的 MCS 通常被称为运行; 挂号小于$2 的 MCS 是最大缺口重复的特例 。 我们显示, 一长的 美元字符串包含$\ mathcal O( n ⁇ 1.5} $ MCS) 。 我们还提供一种对输出敏感的算法, 以一个长度为 $n 的字符串在固定大小的字母上, 找到字符串中包含$\ m$m$( n\ log+ m) 时间的所有 MSS 。