The input file is used to eliminate duplicates. It is assumed input will be smaller than the file to append to, and hence to remove dupes, the input is read into a map. Output file is read line by line and any matches found to input map are removed. In the end, remaining elements are written to the output file.
Used struct map instead of bool map as they occupy lesser space.
Major changes -
The input file is used to eliminate duplicates. It is assumed input will be smaller than the file to append to, and hence to remove dupes, the input is read into a map. Output file is read line by line and any matches found to input map are removed. In the end, remaining elements are written to the output file.
Used struct map instead of bool map as they occupy lesser space.