![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构和算法
文章平均质量分 78
XILEO
计算机专业,比较喜欢的方向是计算机网络,对数学和算法也很感兴趣
展开
-
线性规划
最大子数组 #include #include #include using namespace std; int maxSubset(int a[], int low, int high) { int temp = 0, sum = INT_MIN; for (int i = low; i <= high; i++) { temp += a[i]; if (temp > su转载 2015-11-10 08:59:49 · 498 阅读 · 0 评论 -
分治策略
分治法的常见问题转载 2015-11-09 22:43:04 · 531 阅读 · 0 评论 -
KMP模式匹配算法
计算字符串特征向量(优化版) int *findNext(string P) { int i = 0; int k = -1; int m = P.length();//m为字符串P的长度 assert(m > 0);//若m=0,退出 int *next = new int[m];//动态存储区开辟整数数组 assert(next != 0);//若开辟失败,退出 next[0]转载 2015-11-12 09:27:16 · 292 阅读 · 0 评论