编程实现动态规划的算法实验报告(12)

时间:2025-07-11

这是一份实验报告,内容是矩阵连乘问题和最长公共子序列问题

input = "S" + input;

y = input.toCharArray();

int[][] b = newint[x.length][y.length];

int[][] c = New int[x.length][y.length];

lcsLength(x, y, c, b);

// 计算最优值

lcs(x.length- 1, y.length

- 1, x, b);

// 构造最长公共子系列

int

size = resultList.size();

System.out.print("最长公共子系列为:"); for(

int

i = 0; i < size; i++) {

System.out.print(resultList.get(i));

}

System.out.println("\n");

}

catch

(IOException e) {

e.printStackTrace();

}

System.

out.print("继续输入请按y。。退出请按任意键!");

a=scan.nextLine();

}

while

(a.equals("y"));

}

}

连乘问题

编程实现动态规划的算法实验报告(12).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219