Cocktail Sort

Cocktail sort, also known as bidirectional bubble sort, cocktail shaker sort, shaker sort (which can also refer to a variant of selection sort), ripple sort, shuffle sort, shuttle sort or happy hour sort, is a variation of bubble sort that is both a stable sorting algorithm and a comparison sort. The algorithm differs from a bubble sort in that it sorts in both directions on each pass through the list. This sorting algorithm is only marginally more difficult to implement than a bubble sort, and solves the problem of turtles in bubble sorts.

Read more about Cocktail Sort:  Pseudocode, Differences From Bubble Sort, Complexity

Famous quotes containing the word sort:

    In literary circles, the men of trust and consideration, bookmakers, editors, university deans and professors, bishops, too, were by no means men of the largest literary talent, but usually of a low and ordinary intellectuality, with a sort of mercantile activity and working talent. Indifferent hacks and mediocrities tower, by pushing their forces to a lucrative point, or by working power, over multitudes of superior men, in Old as in New England.
    Ralph Waldo Emerson (1803–1882)