![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法导论
文章平均质量分 66
犹影随行
这个作者很懒,什么都没留下…
展开
-
算法导论:快速排序代码
#include using namespace std; void exchange(int& a, int& b) { int temp; temp = a; a = b; b = temp; } int part(int* a,int p,int r) { int x = a[r]; int i = p-1; for(int j翻译 2015-02-12 08:24:27 · 344 阅读 · 0 评论 -
算法导论:动态规划
top-down实现 #include #include #include using namespace std; int cutRod(int* p, int n) { if(n==0) return 0; int q = INT_MIN; for(int i=1;i<=n;i++) { q=max(q,p[i-1]+c翻译 2015-02-14 12:43:55 · 549 阅读 · 0 评论