计算机科学 > 数据结构与算法
[提交于 2014年12月15日]
标题:Online Detection of Repetitions with Backtracking
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:In this paper we present two algorithms for the following problem: given a string and a rational $e > 1$, detect in the online fashion the earliest occurrence of a repetition of exponent $\ge e$ in the string. 1. The first algorithm supports the backtrack operation removing the last letter of the input string. This solution runs in $O(n\log m)$ time and $O(m)$ space, where $m$ is the maximal length of a string generated during the execution of a given sequence of $n$ read and backtrack operations. 2. The second algorithm works in $O(n\log\sigma)$ time and $O(n)$ space, where $n$ is the length of the input string and $\sigma$ is the number of distinct letters. This algorithm is relatively simple and requires much less memory than the previously known solution with the same working time and space. a string generated during the execution of a given sequence of $n$ read and backtrack operations.
提交历史
来自:Dmitry Kosolobov[v1] 2014年12月15日 星期一 06:13:22 UTC