最长公共子序列(Longest common subsequence problem) It is a classic computer science problem, the basis of file comparison programs such as diff
这个写的非常详细
http://www.ruanyifeng.com/blog/2012/08/how_to_read_diff.html