Close

First steps

A project log for YAMS Yet Another Merge Sort

There are already so many sorting algorithms... So let's make another!

yann-guidon-ygdesYann Guidon / YGDES 08/18/2022 at 00:590 Comments

Today, Thursday 2022/8/18, I created the project and uploaded the first file sort_20220818.html.txt which contains some basic code for testing the algorithm.

There is a crude "waveform generator" that proved precious because it showed early problems with my run-detection algorithm.

In this example, the start of the down-slope would stutter, because there are many small runs of equal values. Here I represent the "undefined slope" with green bars, while the algorithm has not found an upwards or downwards slope. This greatly reduces the number of small runs at the cost of stability but this is not a concern for my applications.

The rest of the test cases seem to work as expected:

The effect of this slope-finding code is that runs have at least 2 data, unless this is the very last item in the input stream.

There is some code to manage a stack, now I have to find the best way to use it...

Discussions