Given a string S of length n, design an efficient algorithm which computes the l
ID: 3767682 • Letter: G
Question
Given a string S of length n, design an efficient algorithm which computes the longest palindromic subsequence of S (not necessarily consecutive). A palindromic string is one which reads the same front and back. For example, the string RAECEDCAUR has inside it palindromes RR, RAECEAR, RACECAR, etc. At first, you provide a recursive definition of the length of a longest palindromic subsequence of a string. Based on this recursive definition, you provide a dynamic programming algorithm. Your algorithm must run in time O(n2).
Explanation / Answer
he string RAECEDCAUR has inside it palindromes RR, RAECEAR, RACECAR, etc. At first, you provide a recursive definition of the length of a longest palindromic subsequence of a string. Based on this recursive definition, you provide a dynamic programming algorithm. Your algorithm must run in time O(n2)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.