Share with your friends
hdshahin01

Call

Cocktail shaker sort, also known as bidirectional bubble sort, cocktail sort, shaker sort , ripple sort, shuffle sort, or shuttle sort, is an extension of bubble sort. The algorithm extends bubble sort by operating in two directions. While it improves on bubble sort by more quickly moving items to the beginning of the list, it provides only marginal performance improvements.

Like most variants of bubble sort, cocktail shaker sort is used primarily as an educational tool. More performant algorithms such as timsort, or merge sort are used by the sorting libraries built into popular programming languages such as Python and Java.

Talk Doctor Online in Bissoy App