Skip to content

Commit 313d5b6

Browse files
committed
Added Cocktail shaker Sort description
1 parent bce30b8 commit 313d5b6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ __Properties__
3030
* Best case performance O(n+k)
3131
* Average case performance O(n+k)
3232

33+
### Coctail shaker
34+
![alt text][cocktail-shaker-image]
35+
36+
From [Wikipedia][cocktail-shaker-wiki]: 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 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.
37+
38+
__Properties__
39+
* Worst case performance O(n^2)
40+
* Best case performance O(n)
41+
* Average case performance O(n^2)
42+
3343

3444
### Insertion
3545
![alt text][insertion-image]
@@ -162,6 +172,9 @@ Mathematically a bijective function is used on the characters' positions to encr
162172
[bucket-image-1]: https://commons.wikimedia.org/wiki/File:Bucket_sort_1.svg#/media/File:Bucket_sort_1.svg
163173
[bucket-image-2]: https://commons.wikimedia.org/wiki/File:Bucket_sort_2.svg#/media/File:Bucket_sort_2.svg
164174

175+
[cocktail-shaker-wiki]: https://en.wikipedia.org/wiki/Cocktail_shaker_sort
176+
[cocktail-shaker-image]: https://upload.wikimedia.org/wikipedia/commons/e/ef/Sorting_shaker_sort_anim.gif
177+
165178
[insertion-toptal]: https://www.toptal.com/developers/sorting-algorithms/insertion-sort
166179
[insertion-wiki]: https://en.wikipedia.org/wiki/Insertion_sort
167180
[insertion-image]: https://upload.wikimedia.org/wikipedia/commons/7/7e/Insertionsort-edited.png "Insertion Sort"

0 commit comments

Comments
 (0)