- wendubuchangyaliceshi 基于人工神经网络的压力传感器的温度补偿
- Notepad4 简单记事本程序
- myblog 本网站是个人博客
- mofang 可以在网页上玩的魔方
- Phonebook-management 一个电话簿管理小程序
- ESAB-2005_Welding-Handbook-Eighth-edition This book describes the welding job and associated procedures and methods in a simple language with images to illustrate the whole process as applied to the oil gas field pipelines. The book is mainly for the welders working in the oil gas fields.
文件名称:kmp
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:55.64kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
问题:串的模式匹配算法---KMP
方法:从主串S中寻找模式串T出现的位置。
基本思想:从主串S的第1个字符起和模式串T的第一个字符比较,若相等,则继续逐个比较后续字符;否则从主串的下一个字符再重新和模式的字符比较;依此类推,直到在主串S中找到模式串T的全部字符相匹配为止,这时匹配成功,否则匹配不成功;KMP算法可以在O(n+m)的时间数量级上完成串的模式匹配操作。其改进在于:每当一趟匹配过程中出现字符比较不等时,不需回溯i指针,而得利用已经得到的“部分匹配”的结果将模式向右滑动尽可能远的一段距离后,继续比较。-The problem: string pattern matching algorithm--- KMP method: to find the position of the pattern string T from the main string S. Basic idea: from a character from the main string S and the first character of the mode string T if equal, continue to compare apples to apples Subsequent characters Otherwise, the next character from the main string and re-mode character comparisons and so on, until all of the characters of the pattern string T found in the main string S match, whereupon the matching is successful, otherwise the match is unsuccessful KMP algorithm can be completed in the level of O (n+m) the amount of time the pattern of the string matching operation. The improvement comprising: varying character comparisons, do not need to backtrack to the i pointer has been " partial match" results, derived from the use of sliding mode right as far a distance as possible whenever the trip matching process, continue comparison.
方法:从主串S中寻找模式串T出现的位置。
基本思想:从主串S的第1个字符起和模式串T的第一个字符比较,若相等,则继续逐个比较后续字符;否则从主串的下一个字符再重新和模式的字符比较;依此类推,直到在主串S中找到模式串T的全部字符相匹配为止,这时匹配成功,否则匹配不成功;KMP算法可以在O(n+m)的时间数量级上完成串的模式匹配操作。其改进在于:每当一趟匹配过程中出现字符比较不等时,不需回溯i指针,而得利用已经得到的“部分匹配”的结果将模式向右滑动尽可能远的一段距离后,继续比较。-The problem: string pattern matching algorithm--- KMP method: to find the position of the pattern string T from the main string S. Basic idea: from a character from the main string S and the first character of the mode string T if equal, continue to compare apples to apples Subsequent characters Otherwise, the next character from the main string and re-mode character comparisons and so on, until all of the characters of the pattern string T found in the main string S match, whereupon the matching is successful, otherwise the match is unsuccessful KMP algorithm can be completed in the level of O (n+m) the amount of time the pattern of the string matching operation. The improvement comprising: varying character comparisons, do not need to backtrack to the i pointer has been " partial match" results, derived from the use of sliding mode right as far a distance as possible whenever the trip matching process, continue comparison.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
kmp.pdf
1999-2046 搜珍网 All Rights Reserved.
本站作为网络服务提供者,仅为网络服务对象提供信息存储空间,仅对用户上载内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
