动态规划做最长公共子序列(LCS)

动态规划做最长公共子序列(LCS) 递推公式如下: 在程序中构建一个如下的长度矩阵 代码如下: #include<iostream> #include<cstring> using namespace std; string a,b; //a串和b串 int lena,lenb; //lena为a串的长度,lenb为b串的长度 int len[1000][1000]; //长度空间
相关文章
相关标签/搜索