An O(n log n) algorithm for finding all repetitions in a string
Journal of Algorithms
Theoretical Computer Science
Algorithms on strings, trees, and sequences: computer science and computational biology
Algorithms on strings, trees, and sequences: computer science and computational biology
Data compression via textual substitution
Journal of the ACM (JACM)
Bidirectional construction of suffix trees
Nordic Journal of Computing - Special issue: Selected papers of the Prague Stringology conference (PSC'02), September 23-24, 2002
SPIRE'06 Proceedings of the 13th international conference on String Processing and Information Retrieval
New simple efficient algorithms computing powers and runs in strings
Discrete Applied Mathematics
Hi-index | 0.00 |
A square is the concatenation of two identical non-empty strings. Let S be the input string which is given character by character. Let m be the (unknown) smallest integer such that the m-th prefix of S contains a square. The online square detection problem is to determine m as soon as the m-th character of S is read. The best previously known algorithm of the online square detection problem, due to Leung, Peng, and Ting, runs in O(mlog2m) time. We improve the time complexity to O(mlog β), where β is the number of distinct characters in the m-th prefix of the input string. It is not difficult to implement our algorithm to run in expected O(m) time.