Question: Background: You are given two DNA sequences, sequence 1 with size n characters and sequence 2 with m characters. DNA sequences are composed of the
Background: You are given two DNA sequences, sequence
with size n characters and sequence with m characters. DNA sequences are composed
of the characters ACG and T Each DNA sequence may contain two consecutive
sequences: sequencesequencesequence and sequencesequencesequence
For example, sequenceAGACTACCG sequence may contain two consecutive se
quences sequence and sequenceAGACTACCG or sequence may contain two
sequences sequenceA and sequenceGACTACCG or sequence may contain
two sequences sequenceAGACTACCG and sequence
Your task is to find two sequences, sequence and sequence such that: The
length of the longest common subsequence LCS of sequence and sequence is equal
to the length of the LCS of sequence and sequence The total number of characters
in sequence and sequence is minimized. The output should be the length of the LCS
and the total length of the two sequences, sequence and sequence that you have
found.
An Onmtime algorithm is suce to pass any feasible test cases.
Hint: use the dynamic programming algorithm for longest common subsequence prob
lem.
a Input You need to read the input from the console. It contains two lines, each
containing one sequence. In the first line of the input, we have n characters; and in
the second line of the input, we have m characters. You can assume that n
and m
b Output You need to output to the console. The first line is an integer indicating
the length of the LCS between the given two sequences. The second line is the total
length of the two sequences, sequence and sequence
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
