463 views
2 votes
2 votes

image:test4_1.png

We wish to find the longest common palindromic subsequence in a string. Read the above code snippet and choose the missing statements.

a)S1: DP[i][j]=0; 
S2: DP[i][j] =1+DP[i+1][j-1] 
S3: DP[i+1][j] ,DP[i][j-1]

b) DP[i][j]=0; 
S2: DP[i][j] =2+DP[i+1][j-1] 
S3: DP[i][j] ,DP[i+1][j-1]

c)S1: DP[i][j]=1; 
S2: DP[i][j] =2+DP[i+1][j-1] 
S3: DP[i+1][j] ,DP[i][j-1]

d) S1: DP[i][j]=1; 
S2: DP[i][j] =2+DP[i+1][j-1] 
S3: DP[i+1][j] ,DP[i+1][j-1]

Please log in or register to answer this question.

Related questions

2 votes
2 votes
2 answers
3
Pooja Palod asked Dec 1, 2015
9,203 views
For X= BDCABA and Y=ABCBDAB find length of lcs and no of such lcs..(solve it using table method)
0 votes
0 votes
1 answer
4