{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# 3 - Computer Science C73 Scarborough Campus Homework...

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

Computer Science C73 October 24 2007 Scarborough Campus University of Toronto Homework Assignment #3 Due: November 7 2007, by 12 noon (in the course drop box) Appended to this document is a cover page for your assignment. Fill it out, staple your answers to it, and deposit the resulting document into the course drop box. Please do not enclose your assignment in an envelope. Question 1. (10 marks) Recall the dynamic programming algorithm to compute the edit distance of two strings discussed in class (and in KT 6.7). Suppose the two input strings are “SNOOP” and “LOOPY”. a. Show the two-dimensional array of values computed by the algorithm when finding the edit distance of these strings. b. Draw the DAG of subproblems solved in this example, and label each edge with 1 (if it corresponds to extending an alignment by inserting, deleting, or changing a letter), or 0 (if it corresponds to extending an alignment by matching letters). Identify a shortest path in this DAG from the node corresponding to the smallest subproblem solved (computing the edit distance between the empty string and the empty string) to the node corresponding to the largest subproblem solved (computing the edit distance between “SNOOP” and “LOOPY”). c. Suppose we want to output a shortest sequence of editing operations (of the form insert X, delete X, or change X to Y, where X and Y are letters) that transforms the first string to the second. Explain how this sequence can be derived from the shortest path that you identified in part (b).

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 / 3

3 - Computer Science C73 Scarborough Campus Homework...

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

View Full Document
Ask a homework question - tutors are online