随笔分类 -  算法分析与设计---动态规划(DP)

摘要:1 #include<stdio.h> 2 #include<stdlib.h> 3 #define MAXN 1000000 4 void Matrix_Chain_Order(int * p, int * s, int N) 5 { 6 int n = N - 1; 7 int m[N][N]; 8 for(int i = 1; i <= n; i++) 9 {10 m[i][i] = 0; 11 } 12 for(int l = 2; l <= n; l+... 阅读全文
posted @ 2012-11-25 18:39 缓冲区溢出 阅读(312) 评论(0) 推荐(0)
摘要:1 #include<stdio.h> 2 #include<stdlib.h> 3 void Fastest_Way(int * a, int n, int * t, int * e, int * x) 4 {//定义一个二维数组a[2][n],二维数组t[2][n-1] 5 //定义一位数组e[2],x[2]; 6 int f[2][n]; 7 int l[2][n]; 8 int F, L; 9 f[0][0] = e[0] + *(a); //开始进入装配线1 10 f[1][0] = e[1] + *(a + n); /... 阅读全文
posted @ 2012-11-22 23:53 缓冲区溢出 阅读(286) 评论(0) 推荐(0)