arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 0810.0264cs.DS
收藏

一种快速通用序列匹配算法

A Fast Generic Sequence Matching Algorithm

David R. Musser, Gor V. Nishanov

摘要:

一个字符串匹配-更一般地说,序列匹配-算法,有一个线性的最坏情况下的计算时间界限,一个低的最坏情况下的界限上的比较次数(2n),和次线性平均情况下的行为,这是优于最快版本的Boyer-Moore算法。该算法在各种各样的序列匹配问题中保留了其效率优势,包括传统的字符串匹配;大字母问题(如Unicode字符串);和小字母,长模式问题(如DNA搜索)。由于它被表示为在任意类型T上的序列中进行搜索的通用算法,因此它非常适合用于通用软件库,例如C++标准模板库。该算法是通过在Knuth-Morris-Pratt算法中添加来自Boyer-Moore算法的模式移位技术之一而获得的,并在该技术中使用散列。在散列函数或对序列的随机访问不可用的情况下,算法回退到Knuth-Morris-Pratt算法的优化版本。

英文摘要:

A string matching -- and more generally, sequence matching -- algorithm is presented that has a linear worst-case computing time bound, a low worst-case bound on the number of comparisons (2n), and sublinear average-case behavior that is better than that of the fastest versions of the Boyer-Moore algorithm. The algorithm retains its efficiency advantages in a wide variety of sequence matching problems of practical interest, including traditional string matching; large-alphabet problems (as in Unicode strings); and small-alphabet, long-pattern problems (as in DNA searches). Since it is expressed as a generic algorithm for searching in sequences over an arbitrary type T, it is well suited for use in generic software libraries such as the C++ Standard Template Library. The algorithm was obtained by adding to the Knuth-Morris-Pratt algorithm one of the pattern-shifting techniques from the Boyer-Moore algorithm, with provision for use of hashing in this technique. In situations in which a hash function or random access to the sequences is not available, the algorithm falls back to an optimized version of the Knuth-Morris-Pratt algorithm.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑