Online algorithms for finding distinct substrings with length and multiple prefix and suffix conditions

Abstract

Let two static sequences of strings P and S, representing prefix and suffix conditions respectively, be given as input for preprocessing. For the query, let two positive integers k1 and k2 be given, as well as a string T given in an online manner, such that Ti represents the length-i prefix of T for 1 ≤ i ≤ |T|. In this paper we are interested in computing the set ansi of distinct substrings w of Ti such that k1 ≤ |w| ≤ k2, and w contains some p ∈ P as a prefix and some s ∈ S as a suffix. More specifically, the counting problem is to output |ansi|, whereas the reporting problem is to output all elements of ansi, for each iteration i. Let σ denote the alphabet size, and for a sequence of strings A, A=Σu∈ A|u|. Then, we show that after O(( P + S)σ)-time preprocessing, the solutions for the counting and reporting problems for each iteration up to i can be output in O(|Ti| σ) and O(|Ti| σ + |ansi|) total time. The preprocessing time can be reduced to O( P + S) for integer alphabets of size polynomial with regard to P + S. Our algorithms have possible applications to network traffic classification.

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…