This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Fall 11: CSci 5421Advanced Algorithms and Data Structures Out 9/21 Homework 2 Due 10/10 Please do all problems; we will grade a subset of three to four problems. Any Exercise/Problem numbers refer to the 3rd edition of the text. (Corresponding numbers for the second edition are given, where available, in parentheses.) Please follow all of the instructions given in the handout for Homework 1. 1. (9 points) Ex. 15.2-5, p. 378. (Ex. 15.2-4, p. 338 in the 2nd edition.) 2. (12 points) Give a top-down, memoized version of the algorithm LCS-Length ( X,Y ) to compute, in O ( mn ) time, the length of a longest common subsequence of strings X and Y , where m = | X | and n = | Y | . (You do not have to retrieve the LCS itself; just compute its length.) Give a careful analysis of the running time. 3. (15 points) Consider the problem of transforming a string, A, of characters into another string, B, by a sequence of insert (I), delete (D), and substitute (S) operations. For instance, the string unix can be transformed to mutiny , as follows: (Here M denotes the non-operation of simply matching two identical characters.) IMDIMIS <- operations A: un i x B: mu tiny That is, we insert an m , match the two u s, delete the...
View Full Document