Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 746 Bytes

File metadata and controls

13 lines (8 loc) · 746 Bytes

Cocktail shaker sort

Cocktail shaker sort, also known as bidirectional bubble sort, cocktail sort, shaker sort (which can also refer to a variant of selection 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.

Complexity

Time (middle/the worst) Memory (middle/the worst)
O(n^2)/O(n^2) O(1)/O(1)

More details

Source