It is well known that the longest common factor (LCF) of two strings over an integer alphabet can be computed in time linear in the total length of the two strings. Our aim here is to present an algorithm that preprocesses two strings S and T in order to answer the following type of queries: Given a position i on S and a letter α, return an LCF of T and S′, where S′ is the string resulting from S after substituting S[i] with α. In what follows, we present an algorithm that, given two strings of length at most n, constructs in O(n log4 n) expected time a data structure of O(n log3 n) space that answers such queries in O(log3 n) time per query. After some trivial modifications, our approach can also support the case of single letter insertions or deletions in S.
CITATION STYLE
Amir, A., Charalampopoulos, P., Iliopoulos, C. S., Pissis, S. P., & Radoszewski, J. (2017). Longest common factor after one edit operation. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 10508 LNCS, pp. 14–26). Springer Verlag. https://doi.org/10.1007/978-3-319-67428-5_2
Mendeley helps you to discover research relevant for your work.