Lcs
Lcs
what is algorithm?
LCS=OUS
Why dynamic
programming for
LCS problem ?
Instead of
recursion
In recursion In dynamic
programing
by retracing the
path of the last
element
we get “BD ” as lcs
if(x[i]=y[J])
{lcs[i,J]=1+lcs[i-1,J-1];}
else {
lcs[i,J]=max(lcs[i-1,J], lcs[i,J-
1]);}
1: SPELL CHECKERS: LCS Can Be Used To Suggest
Corrections In Spelling Or Grammar Checks By
Identifying The Longest Common Subsequence Between
A Misspelled Word And A Dictionary Word