摘要:
最长公共子序列 • 若给定序列X={x1,x2,…,xm},则另一序列Z={z1,z2,…,zk},是X的子序列是指存在一个严格递增下标序列{i1,i2,…,ik}使得对于所有j=1,2,…,k有:zj=xij。 例如,序列Z={B,C,D,B}是序列X={A,B,C,B,D,A,B}的子序列,相应 阅读全文
摘要:
动态规划&矩阵连乘 动态规划的概念 • 与分治方法类似 分-治-合 • 与分治方法不同 子问题之间并非相互独立 • 基本思想 用一个表记录所有子问题的解,不管子问题是否被用到,只要它被计算过,就将其结果备份至表中 动态规划的基本要素 • 最优子结构 利用问题的最优子结构性质,以自底向上的方式递归地从 阅读全文