Question: I am providing you with the source code to the longest common subsequence LCS . java. The source code can be found in the files

I am providing you with the source code to the longest common
subsequence LCS.java. The source code can be found in the files
section of canvas, in a folder named HW4. Please modify the skeleton
code to solve the following tasks.
1. Implement the lcs_length() function, as discussed in lecture.
2. You should not return the double-array b and c as in the
pseudocode. Instead, return the length of the longest common
subsequence.
3. Hint: To get the i-th character in a string s, use s.charAt(i). For
example, the code:
String s = XYZ ;
System.out.println(s.charAt(1));
prints out Y.
public class LCS {
public static int lcs_length (String X, String Y){
/*
* fill in your code here
* Note: return the length of LCS, instead of c and b
*/
}
/**
* @param args
*/
public static void main(String[] args){
// TODO Auto-generated method stub
System.out.println(LCS.lcs_length("ABCBDAB", "BDCABA"));
System.out.println(LCS.lcs_length("ACCGGTCGAGTGCGCGGAAGCCGGCCGAA",
"GTCGTTCGGAATGCCGTTGCTCTGTAAA"));
}
} give me whole code again and what would be the output.

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!