Dynamic text and static pattern matching

  • Authors:
  • Amihood Amir;Gad M. Landau;Moshe Lewenstein;Dina Sokol

  • Affiliations:
  • Bar-Ilan University and Georgia Tech, Ramat-Gan, Israel;University of Haifa and Polytechnic University, Haifa, Israel;Bar-Ilan University, Ramat-Gan, Israel;Brooklyn College of the City University of New York

  • Venue:
  • ACM Transactions on Algorithms (TALG)
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this article, we address a new version of dynamic pattern matching. The dynamic text and static pattern matching problem is the problem of finding a static pattern in a text that is continuously being updated. The goal is to report all new occurrences of the pattern in the text after each text update. We present an algorithm for solving the problem where the text update operation is changing the symbol value of a text location. Given a text of length n and a pattern of length m, our algorithm preprocesses the text in time O(n log log m), and the pattern in time O(m log m). The extra space used is O(n + m log m). Following each text update, the algorithm deletes all prior occurrences of the pattern that no longer match, and reports all new occurrences of the pattern in the text in O(log log m) time. We note that the complexity is not proportional to the number of pattern occurrences, since all new occurrences can be reported in a succinct form.