文件名称:KMP匹配算法
介绍说明--下载内容均来自于网络,请自行研究使用
由于简单模式匹配算法在一次字符比较失败后,简单的把模式串位置向前移动一个字符位置,这样就丢掉了前面字符匹配中得到的信息,效率差。所以就需要一种无回溯的算法来提高效率,这里使用KMP(Knuth-Morris-Pratt)算法。模式串前面的连续片断部分称“前缀模式”,前缀模式在模式串后部重复出现的情况可以用来避免重复进行已经做过的检查,这是KMP算法中的一个重要概念。-as simple pattern-matching algorithm to compare a character failure, a simple model put forward position Series mobile location of a character, would be lost in front of characters matching the information inefficiently. There is a need for a non-backtracking algorithms to improve efficiency, the use of KMP here (Knuth-Morris-Pratt) algorithm. Model Series in front of a row clips part said "prefix model," prefix string pattern in the pattern of recurring back can be used to avoid duplication of inspection has been done, KMP algorithm is an important concept.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
string.cpp
tou.h
tou.h