I want to merge two files with sorted integers. I want to merge two files to a single file such that there are no duplicates and the merged file should contain the integers in the sorted order. Just some idea or pointer to an implementation will help me a lot.
Hello brett,
there are several known algorithms for that purpose. I feel the K-way-merge algorithm is the best one that I have used for that purpose.
In addition to that you can put up a condition to remove the duplicate entries
Or otherwise you can first remove the duplicate entries from the two sources after/before sorting and then implement the K-way merge algorithm .
Feel free to reply if any doubts.
You would like to check this in case