English

Streaming Pattern Matching with d Wildcards

Data Structures and Algorithms 2020-01-01 v1

Abstract

In the pattern matching with dd wildcards problem one is given a text TT of length nn and a pattern PP of length mm that contains dd wildcard characters, each denoted by a special symbol ?'?'. A wildcard character matches any other character. The goal is to establish for each mm-length substring of TT whether it matches PP. In the streaming model variant of the pattern matching with dd wildcards problem the text TT arrives one character at a time and the goal is to report, before the next character arrives, if the last mm characters match PP while using only o(m)o(m) words of space. In this paper we introduce two new algorithms for the dd wildcard pattern matching problem in the streaming model. The first is a randomized Monte Carlo algorithm that is parameterized by a constant 0δ10\leq \delta \leq 1. This algorithm uses O~(d1δ)\tilde{O}(d^{1-\delta}) amortized time per character and O~(d1+δ)\tilde{O}(d^{1+\delta}) words of space. The second algorithm, which is used as a black box in the first algorithm, is a randomized Monte Carlo algorithm which uses O(d+logm)O(d+\log m) worst-case time per character and O(dlogm)O(d\log m) words of space.

Keywords

Cite

@article{arxiv.1704.01646,
  title  = {Streaming Pattern Matching with d Wildcards},
  author = {Shay Golan and Tsvi Kopelowitz and Ely Porat},
  journal= {arXiv preprint arXiv:1704.01646},
  year   = {2020}
}

Comments

Extended abstract appeared in ESA 2016

R2 v1 2026-06-22T19:09:11.809Z