Optimal On-Line Search and Sublinear Time Update in String Matching

  • Authors:
  • Paolo Ferragina;Roberto Grossi

  • Affiliations:
  • -;-

  • Venue:
  • SIAM Journal on Computing
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.