merge_rosters(path_a, path_b, dest) producing a single sorted file. For extra credit do a true two-pointer merge, but reading both and sorting is acceptable if memory is no concern — implement the two-pointer version here.merge_rosters('a.txt', 'b.txt', 'all.txt') # a: ann,zoe b: boball.txt: ann, bob, zoe
Classic merge step of merge sort, on files.
Read both into lists of stripped lines first.
Advance the pointer whose current name is smaller.