Open roarin-roran opened 2 years ago
Checking for maximal runs when these are found is a good idea. For the later stages, I think this is overly aggressive; one can imagine an input where after one round of merging, the run could be extended, right?
5,6,7,8,4,3,2,1,9,10,11,12
is such an example.
I guess this is an idiosyncrasy of allowing decreasing runs only, right?
oh, I mean very simple tests for the last part. the whole input should be merged after the merge is complete, that sort of thing.
although this will get a little more complicated if #77 is implemented - another reason to create a new archetype there (it can have its own native testing that's separated out from everything else)
in test mode, mergers should assert that all input runs are sorted.
also, for peeksort specifically the mergestack merge method should check that runs are maximal, and that the whole input is merged when it's called in test mode.