Comb Sort

Comb Sort is a modification of Bubble Sort that compares two items across a gap instead of adjacent items which moves items across large distances efficiently. This is very similar to Shellsort which performs a gapped Insertion Sort. Unlike Shellsort, each pass of Comb Sort does not p-sort the array, where any pair of items across a gap of size p is sorted. Comb Sort also does not use a specific gap sequence but rather a shrink factor.

Like Bubble Sort, Comb Sort is in-place but is not stable since it compares and swaps items across a gap > 1. Comb Sort, however, has a best case of $$O(n\log n)$$ instead of Bubble Sort's $$O(n)$$ due to the fact that it has to iterate through all the gaps $$O(\log n)$$ times before reaching a gap of 1 where it can check if the list is sorted.

Algorithm
Comb Sort iterates through the list comparing and swapping items out of order across a gap $$g$$. It then divides the gap by a shrink factor $$s$$ and rounds it to an integer. It repeats this process until it reaches a gap size of 1 where it performs a Bubble Sort or Insertion Sort to finish sorting the list.

A good shrink factor for Comb Sort is $$s = 1.3$$.

Implementation
Implementation of Comb Sort in Java:

Rouge Sort
Rouge Sort is Comb Sort but on gaps $$n-1, n-2, \ldots 2, 1$$. It's a $$O(n^2)$$ sorting algorithm by naively comparing every increment of gaps $$< n$$ and is worse than Comb Sort in every way by nullifying Comb Sort's main advantage over Bubble Sort using the smallest shrink factor possible guaranteeing a $$O(n^2)$$ best, average, and worst case.

3-Smooth Comb
3-Smooth Comb is Comb Sort with 3-smooth number gaps (numbers in the form $$2^p3^q$$) and is a $$O(n\log^2 n)$$ sorting algorithm which it improves upon Comb Sort's worst case of $$O(n^2)$$. This algorithm works from the observation that after 2-sorting and 3-sorting a list, a comb pass of size 1 sorts the entire list. This is due to the Frobenius number of 2 and 3 being 1, and this principle is applied recursively. It's a direct improvement over Rouge Sort by skipping over many gaps, since there are only $$O(\log^2 n)$$ 3-smooth gaps $$< n$$, instead iterating through all numbers $$< n$$.

3-Smooth Comb, like Comb Sort itself, has very limited use as its average case is always beaten by Comb Sort which iterates through $$O(\log n)$$ gaps instead of $$O(\log^2 n)$$. Even as a $$O(n\log^2 n)$$ sorting network, its depth and size are not as good compared to Bitonic Sort or Odd-Even Merge Sort.