An efficient algorithm for online square detection

  • Authors:
  • H. F. Leung;Z. S. Peng;H. F. Ting

  • Affiliations:
  • Department of Computer Science and Engineering, The Chinese University of Hong Kong, Hong Kong;Department of Computer Science, The University of Hong Kong, Hong Kong;Department of Computer Science, The University of Hong Kong, Hong Kong

  • Venue:
  • Theoretical Computer Science - Computing and combinatorics
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

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 log2 h) time where h is the length of the longest prefix of the input string that does not contain a square.