Question: In order to transform one source string of text x [1 m] to a target string y [1 n], we can perform various
• Copy a character from x to z by setting z[j] ← x[i] and then incrementing both i and j. This operation examines x[i].
• Replace a character from x by another character c, by setting z[j] ← c, and then incrementing both i and j. This operation examines x[i].
• Delete a character from x by incrementing i but leaving j alone. This operation examines x[i].
• Insert the character c into z by setting z[j] ← c and then incrementing j, but leaving i alone. This operation examines no characters of x.
• Twiddle (i.e., exchange) the next two characters by copying them from x to z but in the opposite order; we do so by setting z[j] ← x[i + 1] and z[j + 1] ← x[i] and then setting i ← i + 2 and j ← j + 2. This operation examines x[i] and x [i + 1].
• Kill the remainder of x by setting i ← m + 1. This operation examines all characters in x that have not yet been examined. If this operation is performed, it must be the final operation.
Step by Step Solution
3.42 Rating (161 Votes )
There are 3 Steps involved in it
a Dynamic programming is the ticket This problem is slightly similar to the longestcommonsubsequence ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
C-S-A (108).docx
120 KBs Word File
