Given an sequence
X = <x1, x2,...,xm>
and we wish to find aZ
that maximum longest palindrome subsequence ofX
.
c[i,j] = if xi = yj and i > j > 0:
c[i+1, j-1] + 2
if xi != yj and i > j > 0:
max(c[i,j-1], c[i+1,j])
if i = j:
1
if i > j:
0