The Merge Algorithm
The algorithm starts with two sorted files whose keys are comparable. The old records above represent one file; the new records represent the second file; Typically, the files contain similar records or at least similar keys. This algorithm is extremely powerful. As expressed above, the changes occur as time passes. In a different situation, the two files represent concurrent files from an old system and a new system. Some system sort routines have these options built-in. There are many optional outputs:
Shopping carts use this algorithm to calculate changes in charges.
Likewise, as a student finalizes changes in enrollment, this algorithm could help.
Re-engineering of programs uses this process to find changes in data tables.
The algorithm starts with two sorted files whose keys are comparable. The old records above represent one file; the new records represent the second file; Typically, the files contain similar records or at least similar keys. This algorithm is extremely powerful. As expressed above, the changes occur as time passes. In a different situation, the two files represent concurrent files from an old system and a new system. Some system sort routines have these options built-in. There are many optional outputs:
- A combined file
- A file of new records only
- A file of deleted records or keys only
- A file of changes
- An array of statistics, like number of same records, number of deleted, number of new, and many more
- Some combination of outputs
Shopping carts use this algorithm to calculate changes in charges.
Likewise, as a student finalizes changes in enrollment, this algorithm could help.
Re-engineering of programs uses this process to find changes in data tables.