
Introduction to algorithms 3
文章平均质量分 77
xiahuixia111
这个作者很懒,什么都没留下…
展开
-
2.2-2习题总结(选择排序)
(待补全)#include #include #include using namespace std;void select_sort(int A[], int length){ int i,j,key,flag; for(i = 0; i < length - 1; i++) { key = A[i]; flag = i; for(j = i + 1; j原创 2014-01-08 22:21:22 · 743 阅读 · 0 评论 -
2.3-系列习题总结
(待补全)#include #include #include using namespace std;void merge(int A[], int p, int q, int r)//归并排序{ int i,j,k; int n1,n2; n1 = q - p + 1; n2 = r - q; int *L = new int[n1]; int *R = new原创 2014-01-08 22:52:11 · 699 阅读 · 0 评论 -
算法导论第三版4.1习题解答
4.1-2use brute-force to solve the maximum_subarray problem.#include #include #include #includeusing namespace std;void max_subarray(int A[], int low, int high){ int profit = INT_MIN; in原创 2014-02-12 14:49:17 · 1957 阅读 · 0 评论