摘要: DFS : acwing 842 递归搜索树 题库 - AcWing 1 #include<iostream> 2 using namespace std; 3 4 const int N = 10; 5 int n; 6 int path[N]; 7 bool st[N]; 8 9 void df 阅读全文
posted @ 2023-11-14 17:14 rw156 阅读(17) 评论(0) 推荐(0)
摘要: kmp 算法基本思路 1.初始化 j = -1,表示 pattern 当前已被匹配的最后位。2.让 i 遍历文本串 text,对每个 i,执行 3、4来试图匹配 text[i] 和 pattern[j + 1]。3.直到 j 回退到 -1 或者是 text[i] == pattern[j + 1], 阅读全文
posted @ 2023-11-14 00:09 rw156 阅读(26) 评论(0) 推荐(0)