动态规划
public class f {
//矩阵连乘 递归算法
public static int n = 6;
public static int a[] = {
30,35,15,5,10,20,25};
public static int flag[][] = new int[n+1][n+1];
public static int table[][] = new int[n+1][n+1];
//递归方法
public static int matrix(int begin , int end){
// a[begin-1] ... a[end]
int minvalue,tempvalue;
if (begin==end) {
return 0;
}
minvalue = matrix(begin,begin) + matrix(begin+1 , end) + a[begin-1