Question: ( a ) ( 7 points ) A sub - sequence of a string is any ordered subset of characters of that string. palindrome is

(a)(7 points) A sub-sequence of a string is any ordered subset of characters of that string. palindrome is a string that reads the same backward as it does forward.
Given a string \( s \), give a DP solution to find its longest sub-sequence that forms a palindror Your solution should take \( O\left(n^{2}\right)\) time where \( n=|s|\).
Suppose \( s=\) "axdybdac". The longest palindromic sub-sequence is "adbda"
\(\mathrm{a}(.5)\) Let \(\operatorname{opt}(1, n)\) represents the length of the longest sub-sequence of that form palindrome.
\(\mathrm{b}(.5)\). Let opt \((i, j)\) represents the length of the longest sub-sequence of that form: palindrome.
( a ) ( 7 points ) A sub - sequence of a string

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 Programming Questions!