Various diff (longest common subsequence) algorithms, used in practice:
-
Myers' diff, in time O((N+M)D) and space O(N+M), where N and M are the sizes of the old and new version, respectively. See the original article by Eugene W. Myers.
-
Patience diff, in time O(N log N + M log M + (N+M)D), and space O(N+M), which tends to give more human-readable outputs. See Bram Cohen's blog post describing it.