开发者

What is the algorithm of linux diff -y?

开发者 https://www.devze.com 2022-12-19 17:50 出处:网络
Th开发者_开发问答e ever-helpful Wikipedia claims that diff implements Longest Common Subsequence.

Th开发者_开发问答e ever-helpful Wikipedia claims that diff implements Longest Common Subsequence.

This cannot be so. Diff, at least in -y mode, has three types of report: add, remove, and substitute. LCS does not have any concept of 'substitute'.

What is the algorithm of diff? I have reason to not believe that it is Levenshtein distance, but I might have misanalyzed this.


This answer (by ioplex) says that GNU diff implements "O(ND) diff algorithm" by Eugene Myers.

0

精彩评论

暂无评论...
验证码 换一张
取 消