Java: (PROGRAM IN JAVA) Given 3 Strings, find the length of the longest common s
ID: 3715991 • Letter: J
Question
Java: (PROGRAM IN JAVA)
Given 3 Strings, find the length of the longest common subsequence.
Input- The input file NEEDS to be CALLED input2.txt and be in the same directory as the java and class files. The file will contain 3 lines and each line will be one of the three strings.
Output- A number N where the length of the longest common subsequence. This value should be calculated in POLYNOMIAL time using DYNAMIC PROGRAMMING.
Examples: If the input was
aaaaaxbbbbb
bbbbbxccccc
cccccxddddd
then the output would be 1, because the longest common substring in x.
Example 2: if the input file was
ccabacbaabad
dababccaaba
ccddababaaba
then the output would be 8, because the longest common substring is ababaaba.
THE PROGRAM MUST BE IN JAVA AND…..COMPILE WITH THE COMMAND javac *.java and run with command java Project2.
MUST USE DYNAMIC PROGRAMMING.
Explanation / Answer
Following is the answer:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.