Dynamic Programming You Are Given A Long String L Of Symbols From A Finite Alphabet 2224917

Dynamic programming You are given a long string L of symbols from a finite alphabet. Your goal is to find the matching substrings of L with a shorter string S from the same alphabet. However, matches need not be exact: You can delete one element of L or S for a penalty of 1, and you can also substitute an element of L for an element of S for a penalty of 1. So, for example, the match between the string L = “text” and S = “tx” is “te” with a penalty of 1 (one substitution), “tex” with a penalty of 1 (one deletion), “ex” with a penalty of 2 (two substitutions), “ext” with a penalty of 2 (one substitution and one deletion), and so on. Use dynamic programming to output all matching substrings of L along with the corresponding penalty.

 

Prof. Angela

4.6/5

Calculate Price


Price (USD)
$