Crunchy Courtyard Sort

is the fastest sort ever, compare it with Sugar Coat 5991 sort. Leaks suggested a comb pass of randomised gap, a reverse comb pass of another randomised gap, and a circle pass. However, as it did not lead to fast sorting, the sort has been made as a variation of a quick sort with O(n log n) worst case.

This algorithm used to be called "Cherry Chateau Sort", but it was renamed. It takes the median of 3 groups of 3 items, then takes the median of those medians, and uses that item as the pivot. If the recursion depth exceeds 2×log2(n), it switches to natural merge sort (which is an adaptive version of merge sort). It uses insertion sort on 24 or less items. This algorithm is also adaptive; it checks if the array is sorted before partitioning; this allows it to be O(n) in the best case.