Cocktail shaker sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent pairs and swaps them if they are in the wrong order. This pass is then done again, in the other direction. The passes through the list are repeated until the list is sorted. Cocktail shaker sort is a comparison sort, i.e. it sorts only by comparing and swapping list elements. https://en.wikipedia.org/wiki/Cocktail_shaker_sort
Part of my series of sorting algorithms: https://scratch.mit.edu/studios/14132246/