Inputs: Two sequences, often represented as strings, let's call them A
and B
.
Goal: Find the shortest edit script that transforms sequence A
into sequence B
. An edit script is a sequence of operations like insertions, deletions, and substitutions.
- Initialize the Matrix:
- Create a matrix with rows representing the characters of sequence
A
and columns representing the characters of sequenceB
. - The matrix will have dimensions
(M+1) x (N+1)
, whereM
is the length of sequenceA
, andN
is the length of sequenceB
.
- Create a matrix with rows representing the characters of sequence