Shortest Unique Palindromic Substring Queries on Run-Length Encoded Strings
For a string S, a palindromic substring S[i..j] is said to be a shortest unique palindromic substring (SUPS) for an interval [s, t] in S, if S[i..j] occurs exactly once in S, the interval [i, j] contains [s, t], and every palindromic substring containing [s, t] which is shorter than S[i..j] occurs at least twice in S. In this paper, we study the problem of answering SUPS queries on run-length encoded strings. We show how to preprocess a given run-length encoded string RLE_S of size m in O(m) space and O(m (σ_RLE_S + √( m / m))) time so that all SUPSs for any subsequent query interval can be answered in O(√( m / m) + α) time, where α is the number of outputs, and σ_RLE_S is the number of distinct runs of RLE_S.
READ FULL TEXT