Longest Common Subsequence

San Skulrattanakulchai

October 30, 2019

Notation

Definitions

Problem

Solution by dynamic programming

Optimal substructure property

Example OPT table

M A R C H
A 2 2 1 0 0 0
P 1 1 1 0 0 0
R 1 1 1 0 0 0
I 0 0 0 0 0 0
L 0 0 0 0 0 0
0 0 0 0 0 0

LCS algorithm