Homework 3

Homework 3 - W07/CS592 Suggested Solutions to Homework...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
W07/CS592 Suggested Solutions to Homework Three Design and Analysis of Algorithms Due: Mar. 6, 2007 There are 5 problems 1 . Find an optimal parenthesization of a matrix chain product whose sequence of dimensions is (7, 11, 4, 9, 3, 16). 2 Page 356, Exercise 15.4-5. Give an O( n 2 )-time algorithm to find the longest monotonically increasing subsequence of a sequence of n numbers. 3 Two character strings may have many common substrings. For example, establish and stability have common strings s , st , sta , stab , l , li , ab , etc. The longest one is stab . Let X = x 1 x 2 x n and Y = y 1 y 2 y m be two character strings. Give a dynamic programming algorithm to find the longest common substring for X and Y. Note. A common string is different from a common subsequence. A common string must contain consecutive characters in both X and Y. You only need to show the formula by which you can construct the solution, and the initial values. Detailed coding is not required.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Homework 3 - W07/CS592 Suggested Solutions to Homework...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online