Text Indexing and Pattern Matching with Ephemeral Edits

Abstract

A sequence e0,e1,… of edit operations in a string T is called ephemeral if operation ei constructing string Ti, for all i=2k with k∈N, is reverted by operation ei+1 that reconstructs T. Such a sequence arises when processing a stream of independent edits or testing hypothetical edits. We introduce text indexing with ephemeral substring edits, a new version of text indexing. Our goal is to design a data structure over a given text that supports subsequent pattern matching queries with ephemeral substring insertions, deletions, or substitutions in the text; we require insertions and substitutions to be of constant length. In particular, we preprocess a text T=T[0.\,. n) over an integer alphabet =[0,σ) with σ=nO(1) in O(n) time. Then, we can preprocess any arbitrary pattern P=P[0.\,. m) given online in O(m m) time and O(m) space and allow any ephemeral sequence of edit operations in T. Before reverting the ith operation, we report all Occ occurrences of P in Ti in O( n + Occ) time. We also introduce pattern matching with ephemeral edits. In particular, we preprocess two strings T and P, each of length at most n, over an integer alphabet =[0,σ) with σ=nO(1) in O(n) time. Then, we allow any ephemeral sequence of edit operations in T. Before reverting the ith operation, we report all Occ occurrences of P in Ti in the optimal O(Occ) time. Along our way to this result, we also give an optimal solution for pattern matching with ephemeral block deletions.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…