its a question about algorithmreally thx for ur generous help^_^ i\'d be very ap
ID: 3689387 • Letter: I
Question
its a question about algorithmreally thx for ur generous help^_^
i'd be very appreciate that if u can help me with all subquestions^_^
Explanation / Answer
LCS Problem Statement: Given two sequences, find the length of longest subsequence present in both of them. A subsequence is a sequence that appears in the same relative order, but not necessarily contiguous. For example, “abc”, “abg”, “bdf”, “aeg”, ‘”acefg”, .. etc are subsequences of “abcdefg”. So a string of length n has 2^n different possible subsequences.
For part C the algorithm That I could suggest is First find the LCS for any two of three sequences after that apply LCS again for the result to remaining sequence to get longest subsequence.
ABCB,BDCB,ABCA --->from first two we get BC as subsequence again from BC and ABCA we get BC as the final longest LCS.
For part D the time complexity could be O(n(n1) 2) for 3 strings.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.