How external merge sort algorithm works?
问题 I'm trying to understand how external merge sort algorithm works (I saw some answers for same question, but didn't find what I need). I'm reading the book "Analysis Of Algorithms" by Jeffrey McConnell and I'm trying to implement the algorithm described there. For example, I have input data: 3,5,1,2,4,6,9,8,7 , and I can load only 4 numbers into memory. My first step is read the input file in 4-number chunks, sort them in memory and write one to file A and next to file B. I got: A:[1,2,3,5][7]