LCS Non-Dynamic Version int function lcs (x, y, i, j) begin if (i = 0) or (j = 0) return 0;
LCS Non-Dynamic Version int function lcs (x, y, i, j) begin if (i = 0) or (j = 0) return 0; else if (x[i] = y[j]) return lcs(x, y, i-1, j-1)+1; else return max(lcs(x, y, i-1, j), lcs(x, y, i, j-1)); end ; int x = lcs(“abdabcd”,”cabdaaxy”,7,8);. LCS Dynamic Programming Version
252 views • 11 slides