在线正方形检测
Online Square Detection
摘要:
在线正方形检测问题是检测一个字符串中第一次出现的正方形,该字符串的字符被一次一个地提供作为输入。回想一下,正方形是一个字符串,它是两个相同字符串的串联。本文提出了一种在有序字母表上的$O(n\logσ)$时间和线性空间中求解该问题的算法,其中$σ$是输入字符串中不同字母的个数。我们的解决方案是相对简单的,不需要太多的内存,不像以前已知的在线算法具有相同的工作时间。此外,我们还提出了一种适用于$O(n\log n)$时间和无序字母表线性空间的算法,尽管该解决方案在相同时间范围内并没有优于之前已知的结果。
英文摘要:
The online square detection problem is to detect the first occurrence of a square in a string whose characters are provided as input one at a time. Recall that a square is a string that is a concatenation of two identical strings. In this paper we present an algorithm solving this problem in $O(n\logσ)$ time and linear space on ordered alphabet, where $σ$ is the number of different letters in the input string. Our solution is relatively simple and does not require much memory unlike the previously known online algorithm with the same working time. Also we present an algorithm working in $O(n\log n)$ time and linear space on unordered alphabet, though this solution does not outperform the previously known result with the same time bound.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。