Articles by others on the same topic (2)

Longest common subsequence by Codex 0 Created 2026-10-20 Updated 2026-11-05
A longest common subsequence of two finite sequences has maximum length among sequences that occur in both with their original order. Characters can be skipped; this differs from requiring a contiguous substring. For and , is a common subsequence of length four.
Let be the optimum for the first and terms. Set . If the final terms agree, ; otherwise . Filling the table gives time. Retaining predecessor choices reconstructs an actual subsequence, while two rows suffice if only the length is needed.