Question: ( a ) ( 7 points ) A sub - sequence of a string is any ordered subset of characters of that string. palindrome is
a points A subsequence 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 subsequence that forms a palindror Your solution should take Oleftnright time where ns
Suppose s "axdybdac". The longest palindromic subsequence is "adbda"
mathrma Let operatornameopt n represents the length of the longest subsequence of that form palindrome.
mathrmb Let opt i j represents the length of the longest subsequence of that form: palindrome.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
