Question: Programming Problem. Consider the shortest common supersequence (SCS) problem. The input to the SCS problem is two strings A = A_1...A_M and B = B_1...B_m,

Programming Problem. Consider the shortest common supersequence (SCS) problem. The input to the SCS problem is two strings A = A_1...A_M and B = B_1...B_m, and the output in the length of the shortest string that contains both A and B as subsequences. Examples: A = ABCBABA, B = BCAABAB, then the SCS = ABCA ABABA, so the len(SCS) = 9. Given that the recurrence relationship is as follows, implement a dynamic programming algorithm to solve the SCS problem. Let SCS (i, j) be the length of the shortest common supersequence of A[1.,i| and B[1.,j]. Your algorithm must run in O(mn) time. Your program should prompt the user to enter two strings and output the length of the shortest common supersequence, not the actual SCS
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
