基于后缀树的多前缀、单后缀计数和列表问题的线性算法
Suffix tree-based linear algorithms for multiple prefixes, single suffix counting and listing problems
摘要:
给定两个字符串$T$和$S$以及一组字符串$P$,对于每个字符串$p \in P$,考虑以$p$作为其前缀、以$S$作为其后缀的$T$的唯一子字符串。然后会出现两个问题;第一个问题是计算这样的子串,第二个问题是列出所有这样的子串。在本文中,我们描述了线性时间,线性空间后缀树为基础的算法这两个问题。更具体地说,我们描述了用于计数问题的$O(|T| + |P|)$时间算法,以及用于列表问题的$O(|T| + |P| + \#(ans))$时间算法,其中$\#(ans)$是指总共列出的字符串的数量,并且$|P|$是指$P$中的字符串的总长度。我们还考虑了反向版本的问题,其中一个前缀条件字符串和多个后缀条件字符串,而不是,并同样描述线性时间,线性空间算法来解决它们。
英文摘要:
Given two strings $T$ and $S$ and a set of strings $P$, for each string $p \in P$, consider the unique substrings of $T$ that have $p$ as their prefix and $S$ as their suffix. Two problems then come to mind; the first problem being the counting of such substrings, and the second problem being the problem of listing all such substrings. In this paper, we describe linear-time, linear-space suffix tree-based algorithms for both problems. More specifically, we describe an $O(|T| + |P|)$ time algorithm for the counting problem, and an $O(|T| + |P| + \#(ans))$ time algorithm for the listing problem, where $\#(ans)$ refers to the number of strings being listed in total, and $|P|$ refers to the total length of the strings in $P$. We also consider the reversed version of the problems, where one prefix condition string and multiple suffix condition strings are given instead, and similarly describe linear-time, linear-space algorithms to solve them.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。