Cocktail Sort Algorithm

Cocktail shaker sort, also known as bidirectional bubble sort, cocktail sort, shaker sort (which can also refer to a variant of choice sort), ripple sort, shuffle sort, or shuttle sort, is an extension of bubble sort. like most variants of bubble sort, cocktail shaker sort is used chiefly as an educational tool.

Cocktail Sort source code, pseudocode and analysis