Algorithms in the Real World (15-853), Fall 09Assignment #5Due: Nov 12You can look up material on the web and books, but you cannot look up solutions to the givenproblems. You can work in groups, but must write up the answers individually.Problem 1: Solving a Recurrence (5pt)For the space-efficient Edit Distance problem (Lecture 3), we used the recurrence:T(n, m)=T(n/2, k) +T(n/2, m-k) +O(mn)T(1, m)=mT(n,1)=nGive a formal proof thatT(m, n) =O(mn).Problem 2: 10ptGiven two stringsS1andS2and a textT, you want to find whether there is an occurrence ofS1andS2interwoven inT, possibly with spaces. For example, the stringsabacandbbcoccur inter-woven incabcbabcca. Give an efficient algorithm for this problem (i.e. one that is polynomialin the size of the inputs).Problem 3: 10ptConsider the following gap model – each insertion or deletion costs a unit. However, if there aremore thankconsecutive insertions, orkconsecutive deletions, they cost onlykunits. Give an
This is the end of the preview.
access the rest of the document.