LCS

Back to Classic Problems (DP)

Longest Common Subsequence: find the longest subsequence common to two sequences. Solved with DP in O(mn) time and space. Used in diff tools (comparing files), bioinformatics (DNA sequence alignment), and version control systems.

algorithms dynamic-programming lcs