Heikki Linnakangas <hlinn...@iki.fi> writes: > On 30/06/2024 12:48, Andy Fan wrote:
>> for example, at the first use of outputTapes[x], it stores (1, 3, 5, >> 7), >> and later (2, 4, 6, 8) are put into it. so the overall of (1, 3, 5, 7, >> 2, 4, 6, 8) are not sorted? Where did I go wrong? > > There's a distinction between "runs" and "tapes". Each "run" is sorted, > but there can be multiple runs on a tape. In that case, multiple merge > passes are needed. Note the call to markrunend() between the runs. In > your example, the tape would look like (1, 3, 5, 7, <end marker>, 2, 4, > 6, 8). I see, Thank you for your answer! -- Best Regards Andy Fan