{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw2 - Fall 11 CSci 5421Advanced Algorithms and Data...

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

Fall 11: CSci 5421—Advanced 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 n , insert a t , match the two i ’s, insert an n , and substitute x

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

hw2 - Fall 11 CSci 5421Advanced Algorithms and Data...

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

View Full Document
Ask a homework question - tutors are online