随笔分类 -  算法

摘要:int strStr(string &haystack, string &needle) { const int needlesize = needle.size(); if (needlesize == 0) { return 0; } vector<int> next(needlesize, 0 阅读全文
posted @ 2022-02-24 23:35 ug_难 阅读(34) 评论(0) 推荐(0) 编辑
摘要:先上代码: class KMP { using DFA_t = vector< vector<int> >; public: KMP(const string &needle) : m_NeedleSize{ (int)needle.size() }, m_DFA(TOTAL_CHAR, std:: 阅读全文
posted @ 2022-02-23 22:23 ug_难 阅读(38) 评论(0) 推荐(0) 编辑
摘要:暴力字符串查找算法实现一 virtual int FindStr(const string &haystack, const string &needle) override { const int strSize = haystack.size(); const int patSize = nee 阅读全文
posted @ 2022-02-22 22:22 ug_难 阅读(54) 评论(0) 推荐(0) 编辑
摘要:代码: #include <stack> #include <iostream> #include <vector> #include <random> #include <time.h> using std::cout; using std::stack; using std::vector; u 阅读全文
posted @ 2022-01-06 03:24 ug_难 阅读(24) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示