Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume X and Y are given strings, with |X| = |Y | = n, and assume that |LCS(X, Y )| n10 (that is, all but

Assume X and Y are given strings, with |X| = |Y | = n, and assume that |LCS(X, Y )| n10 (that is, all but at most 10 characters match). Suggest an O(n) time algorithm for finding LCS(X, Y ).

Extend your answer in the following way: Assume a parameter k < n is given. Show how you could find in time O(kn) whether |LCS(X, Y )| n k. Show how this could be used for computing LCS(X, Y ) in time O(nk), where k = n |LCS(X, Y )|. Hint: Assume that the matrix c[1..n, 1..n] is given when all cells are initialized to zero, so you do not need to spend any time initializing them. Show that only O(nk) cells need to be visited.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions