TADM2E 8.1

From Algorithm Wiki
Revision as of 15:57, 23 July 2020 by Matt (talk | contribs) (Undo revision 813 by Hdyldhdlgzos (talk))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is the regular editing dynamic programming, except that the diagonal as an extra possibility when a swap is possible.

M[i, j] = M[i-2, j-2] + 1 ; if A[i] == B[j-1] and A[i-1] == B[j] where i,j > 1