Abstract: A square is a string that can be divided into two identical substrings. The problem of square detection has found applications in areas such as bioinformatics and data compression. There are many offline algorithms for the problem. In this paper, we give the first online algorithm for deciding whether a string contains a square. Our algorithm runs in total O ( h log 2 h ) time where h is the length of the longest prefix of the input string that does not contain a square.
0 Replies
Loading