Detecting regularities on grammar-compressed strings
arXiv:1304.7067
Abstract
We solve the problems of detecting and counting various forms of regularities in a string represented as a Straight Line Program (SLP). Given an SLP of size that represents a string of length , our algorithm compute all runs and squares in in time and space, where is the height of the derivation tree of the SLP. We also show an algorithm to compute all gapped-palindromes in time and space, where is the length of the gap. The key technique of the above solution also allows us to compute the periods and covers of the string in time and time, respectively.