1. 首页
  2. 数据库
  3. Informix
  4. KMP算法学习&总结

KMP算法学习&总结

上传者: 2020-08-29 04:04:38上传 DOC文件 155.5KB 热度 13次
KMP算法学习&总结 1、传统的字符串匹配算法 /* * 从s中第sIndex位置开始匹配p * 若匹配成功,返回s中模式串p的起始index * 若匹配失败,返回-1 */ int index(const std::string &s, const std::string &p, const int sIndex = 0) { int i = sIndex, j = 0; if (s.length() < 1 || p.length() < 1 || sIndex < 0) { return -1; } while (i
下载地址
用户评论
码姐姐匿名网友 2020-08-29 04:04:38

正在学习字符串匹配算法,多谢分享!