Recent questions tagged longest-common-subsequence

2.5k
views
2 answers
0 votes
Consider two strings A = "anandarmy" and B = "algorithms". Let y' be the length of the longest common subsequence (not necessarily contiguous) between A and ... of such longest common subsequences between A and B. Then 2x+3y = _________.
392
views
1 answers
0 votes
How many distinct function calls are there in LCS(m,n)=. How to calculate it?
2.2k
views
2 answers
2 votes
Consider two strings A = “abbaccda” and B = “abcaa” consider "x"be length of the longest common subsequence between A and B and “y” be the number of distinct such longest common subsequences between A and B. Then 10x+ 2y is ________.
427
views
0 answers
1 votes
Consider two strings A = 12341 and B = 341213 .The length of LCS is 3 and they are "121", "123", "341"Now there are two possibilities for the ... be the total no. of subsequence possible 3 or 4(because of two possibilities of "341")
484
views
0 answers
2 votes
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: ... ][j] =2+DP[i+1][j-1] S3: DP[i+1][j] ,DP[i+1][j-1]
938
views
0 answers
1 votes
Determine an LCS of {1,0,0,1,0,1,0,1} (assume A) and {0,1,0,1,1,0,1,1,0} (assume B)If we draw the matrix and ... , how come while backtracking it gives this as a solution.https://gateoverflow.in/?qa=blob&qa_blobid=3569576287134533309
1.4k
views
1 answers
3 votes
For finding longest common subsequence(LCS), standard sources mention that the recursive procedure consisting of the recursive tree occupies O(m+n) space( WITHOUT applying Dynamic ... space should be k=log(m+n).What's wrong with my logic?
6.4k
views
3 answers
4 votes
Given two sequences $X$ and $Y$:$X=\langle a, b, c, b, d, a, b \rangle$Y=\langle b, d, c, a, b, a \rangle$The longest common subsequence of X and Y is:$\langle b ... $\langle b, c, b, a \rangle$
9.7k
views
2 answers
2 votes
For X= BDCABA and Y=ABCBDAB find length of lcs and no of such lcs..(solve it using table method)
To see more, click for the full list of questions or popular tags.