In computer science, **comb sort** is a relatively simplistic sort algorithm designed by Stephen Lacey and Richard Box, who described it in Byte Magazine in April 1991. Comb sort improves on bubble sort and rivals in speed more complex algorithms like Quicksort. The basic idea is to eliminate *turtles*, or small values near the end of the list, since in a bubble sort these slow the sorting down tremendously. (*Rabbits*, large values around the beginning of the list, do not pose a problem in bubble sort.)

In bubble sort, when any two elements are compared, they always have a *gap* (distance from each other) of 1. The basic idea of comb sort is that the gap can be much more than one. The gap starts out at the length of the list being sorted divided by the *shrink factor* (generally 1.3; see below), and the list is sorted with that value for the gap. Then the gap is divided by the shrink factor again, the list is sorted with this new gap, and the process repeats until the shrink factor is 1. At this point, comb sort performs the final sort in the same manner. The final sort is thus equivalent to a bubble sort, but by this time most turtles have been dealt with, so a bubble sort will be efficient.

http://world.std.com/~jdveale/combsort.htm describes an improvement to comb sort using the base value 1.279604943109628 as the shrink factor. It also contains a pseudocode implementation with a pre-defined gap table.

- Bubble sort, a generally slower algorithm, is the basis of comb sort.
- Cocktail sort, or bidirectional bubble sort, is a variation of bubble sort that also addresses the problem of turtles.
- Other sort algorithms