开发者社区 问答 正文

kmp算法的next函数及其修正值怎么求

kmp算法的next函数及其修正值怎么求

展开
收起
知与谁同 2018-07-20 17:18:48 3133 分享 版权
1 条回答
写回答
取消 提交回答
  • 阿里云开发者社区运营负责人。原云栖社区负责人。
    #include #include using namespace std;class KMP{public:// 构造函数KMP(string pattern, string origin):pat(pattern), ori(origin) {next = new int[pattern.size() + 1];next[0] = -1;calcuNext(); // 计算next数组count = 0;}// 计算next...
    2019-07-17 22:56:02
    赞同 展开评论