FINDING ALL APPROXIMATE GAPPED PALINDROMES
Ping-Hui Hsu, Kuan‐Yu Chen, Kun‐Mao Chao · International Journal of Foundations of Computer Science · 2010
We study the problem of finding all maximal approximate gapped palindromes in a string. More specifically, given a string S of length n, a parameter q ≥ 0 and a threshold k > 0, the problem is to identify all substrings in S of the form uvw such that (1) the Levenshtein distance between ur and w is at most k, where ur is the reverse of u and (2) v is a string of length q. The best previous work requires O(k2n) time. In this paper, we propose an O(kn)-time algorithm for this problem by utilizing an incremental string comparison technique. It turns out that the core technique actually solves a more general incremental string comparison problem that allows the insertion, deletion, and substitution of multiple symbols.