Pattern matching in dynamic texts
SODA '00 Proceedings of the eleventh annual ACM-SIAM symposium on Discrete algorithms
Hi-index | 0.00 |
This paper investigates the problem of searching on-line for the occurrences (occ) of an arbitrary pattern of length p in a text of length n subjected to some updates after its preprocessing. Each text update consists of inserting or deleting an arbitrary string of length y. We present the first dynamic algorithm that achieves optimal query time, i.e., $\Theta(p+occ)$, sublinear time per update, i.e., $O(\sqrt{n} + y)$, and optimal space, i.e., $\Theta(n)$, in the worst case. As a result, our algorithm obtains the same query time and space usage of suffix trees [McCreight, J. Assoc. Comput. Mach., 23 (1976), pp. 262--272] while improving their O(n + y) update performance.