84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
新手最近有一个题目,需要使用C++编写一个图形界面,实现两个>1k的文本文件(.txt)的查重,并将重复部分高亮显示。现在已经实现了基本功能,使用QT,可以将A文件中的B文件中的句子高亮显示,但是有一个问题就是,B文件中只能是短语或者是单词,因为使用的是完全匹配算法,如果文章太长就不能找到。现在想实现两篇文章输入,并显示出两篇文章的相同部分,请问使用什么算法?linux下的diff()函数类似。
认证高级PHP讲师
(Currently no idea about the algorithm)
In line with the belief of not reinventing the wheel, I recommend using diff directly, or taking a look at the source code of diff
This is the information link from Baidu
(If you have any ideas, please add more, if not, I will give up_(:3)JL)_
(Currently no idea about the algorithm)
In line with the belief of not reinventing the wheel, I recommend using diff directly, or taking a look at the source code of diff
This is the information link from Baidu
(If you have any ideas, please add more, if not, I will give up_(:3)JL)_