Question: Recursion Lab Longest Palindrome Subsequence (LPS) is a poster child for recursion and very hard to solve in any other way. In this lab

Recursion Lab Longest Palindrome Subsequence (LPS) is a "poster child" for recursion and very hard to solve in any other way. In this lab you will create class named LPS and within that class you will write two methods: 1ps Length (String str) and lpsString (...) Given a string str, lps Length (String str) returns the length of the LPS in str lpsString (...) returns one LPS string You may assume that the initial given string str is not an empty string. Here are some examples. str zryxadavr aaxyz abcxcybza ATGCATCATTGACCA Lps length 5 Lps string radar 2 aa 7 10 abcxcba ACCATTACCA Notice that the sequence "zryxadavr" contains the palindrome subsequence "radar" within it: zryxadavr r ada r In fact, "radar", which has length 5, is the longest palindrome that can be found embedded in "zryxadavr". We say that "radar" is the longest palindromic subsequence (LPS) in the given string "zryxadavr". Example1 Input string: zryxadavr Output: Ips length = 5 Ips string = radar Example 2 Input string: ATGCATCATTGACCA Output: Ips length = 10 Ips string ACCATTACCA Submit you work in ONE Zip file and submit it in Canvas. Zip filename should be in format of FirstLast_Lab2.zip (ex. John Doe_Lab2.zip) Zip file should contain 4 files only: (1) LPS.java (2) LPSDemo.java (3) Output.docx (screenshot/copy program output and put in a word document) (4) Pseudo-code.docx (explain recursive logic in terms of pseudo-code) 2
Step by Step Solution
There are 3 Steps involved in it
To solve the problem of finding the Longest Palindromic Subsequence LPS we need to implement two methods lpsLengthString str and lpsString inside the ... View full answer
Get step-by-step solutions from verified subject matter experts
