Question: Given a string S of characters, a subsequence of S, defined by the indices i1,i2,,im, is said to be a repeated subsequence if you can

 Given a string S of characters, a subsequence of S, defined

Given a string S of characters, a subsequence of S, defined by the indices i1,i2,,im, is said to be a repeated subsequence if you can find another sequence of indices j1,j2,,jm such that S[ik]=S[jk] but also ik=jk for every k=1,,m. Here is an example: the string AAJDDAJJTT has a repeated subsequence of ADJT which occurs at indices 1,4,7,9 and also at indices 2,5,8,10 (here we're using 1-based indexing). Give an efficient dynamic programming algorithm to find the length of the longest repeated subsequence. Please answer the following parts: 1. Define the entries of your table in words. E.g. T(i) or T(i,j) is ... 2. State a recurrence for the entries of your table in terms of smaller subproblems. Don't forget your base case(s). 3. Write pseudocode for your algorithm to solve this problem. 4. State and analyze the running time of your algorithm. Faster (and correct) solutions are worth more credit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!