Online Square Detection
Dmitry Kosolobov

TL;DR
This paper introduces an efficient online algorithm for detecting the first occurrence of a square in a string as characters are received, with improved memory efficiency for ordered alphabets.
Contribution
It presents a simple, memory-efficient online square detection algorithm with optimal time complexity for ordered alphabets, and an alternative solution for unordered alphabets.
Findings
O(n log σ) time and linear space for ordered alphabet
Simpler and more memory-efficient than previous algorithms
O(n log n) time solution for unordered alphabet
Abstract
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 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 time and linear space on unordered alphabet, though this solution does not outperform the previously known result with the same time bound.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · semigroups and automata theory · DNA and Biological Computing
