COMB Sort actually rivals quicksort depending on the order your data is in, and it's easy to implement without recursion. I think COMB is better in the worst case and Quicksort is better in the best case... or it was the other way around.

I used a variation of COMB in a VB application back in the 90s.
The programmer that wrote some code I inherited didn't know how to implement a sort (!?), and the program that ran nightly required quite a bit of interaction from the night crew so it could use an external sort utility.
So I threw in a sort. COMB sorted 85,000+ records in about 15 minutes and the program didn't need any interaction once it was kicked off.
FWIW, Bubble sort didn't complete sorting the same data in 12 hours. I threw that in at first when I couldn't find VB code for quicksort.
I implemented COMB by trying to speed up the code, but I didn't know it was a COMB sort until later.

Hahaha ... no offence, for that matter I could also be from South Africa or Suriname.
But no ... I'm dutch, created in East London, Sout Africa and almost born in London, United Kingdom and almost almost born in Antwerp, Belgium but eventually born in Alkmaar the Netherlands.

Made a translation of your post this afternoon inclusive links to this topic and Wikipedea.

COMB Sort actually rivals quicksort depending on the order your data is in, and it's easy to implement without recursion. I think COMB is better in the worst case and Quicksort is better in the best case... or it was the other way around.

I used a variation of COMB in a VB application back in the 90s.
The programmer that wrote some code I inherited didn't know how to implement a sort (!?), and the program that ran nightly required quite a bit of interaction from the night crew so it could use an external sort utility.
So I threw in a sort. COMB sorted 85,000+ records in about 15 minutes and the program didn't need any interaction once it was kicked off.
FWIW, Bubble sort didn't complete sorting the same data in 12 hours. I threw that in at first when I couldn't find VB code for quicksort.
I implemented COMB by trying to speed up the code, but I didn't know it was a COMB sort until later.

I didn't realize until I read the Wikipedia on Shellsort that it is "fair game" to use different GAPs, even using a list of GAPs.

All that to say I think you discovered Shellsort.

B

Shellsort was my 2nd guess... but I thought shellsort was a gapped insertion sort.
The animations look very different than what my sort does, and it looks much more like comb.
I think the best and worst case are probably the same.

Shellsort was my 2nd guess... but I thought shellsort was a gapped insertion sort.
The animations look very different than what my sort does, and it looks much more like comb.
I think the best and worst case are probably the same.

Do you still have any code lying around?

It sounds then like you made the comb sort independently with a 1/2 GAP which works but may be just slightly sub-optimal compared to 1/1.3

It sounds then like you made the comb sort independently with a 1/2 GAP which works but may be just slightly sub-optimal compared to 1/1.3

Pretty cool work by you.

Code from 1993... ish? Nope. Not that I know of.

Whether or not it's sub optimal would depend on the data. Since the GAP doesn't change every pass, it has the potential to move very out of order items really quickly, and anything moved way too far in the initial passes quickly moves back towards it's final location.
I think it's biggest flaw was the gap change was too large once you got below a certain gap # and there were an excessive number of swaps in the final passes.
It probably should have used a table of GAP values derived from examining the source data. New data was added, but the order didn't change much from one time to the next.

Whether or not it's sub optimal would depend on the data. Since the GAP doesn't change every pass, it has the potential to move very out of order items really quickly, and anything moved way too far in the initial passes quickly moves back towards it's final location.
I think it's biggest flaw was the gap change was too large once you got below a certain gap # and there were an excessive number of swaps in the final passes.
It probably should have used a table of GAP values derived from examining the source data. New data was added, but the order didn't change much from one time to the next.

I will have to play with the 1/2 value to see what happens.

I remember in the Byte Magazine article where I found this sort, they showed a graph where these two guys experimented with gap size s and found this magic 1.3 value. There was a switch as you say when the GAP got below a certain size that they claimed was better but my tests didn't give me an speedup because testing for the condition took more time.

So your name needs to go up there in Wikipedia as one of the independent discoverers of this algorithm.

I remember in the Byte Magazine article where I found this sort, they showed a graph where these two guys experimented with gap size s and found this magic 1.3 value. There was a switch as you say when the GAP got below a certain size that they claimed was better but my tests didn't give me an speedup because testing for the condition took more time.

So your name needs to go up there in Wikipedia as one of the independent discoverers of this algorithm.

Well, I was dealing with 85,000+ records with over a hundred added per month. so the large moves probably made a huge difference.
And remember, my variation used multiple passes like a bubble sort.

If you have 1000 items and just use 1/2 during the first 4 passes, that should get really out of order data within something like 75 or less distance from it's final location.
If your data is almost in order, you may waste 4 passes... but then that's probably true with the regular comb sort with a data set that size.
Instead of multiple passes like my variation, I think the ideal would use a table of data that follows a curve rather than a linear drop.
I'm sure some math whiz could come up with a theoretical formula you could use but I'm not sure there is a one size fits all formula.
Maybe start with half and then have a multiplier that gradually alters the multiplier.
It would be interesting to play with.