Cocktail Sort
Cocktail sort is a minor modification of bubble sort. It differs in that instead of repeatedly running through the list from bottom to top, it passes alternately from bottom to top and then from top to bottom. It can carry out slightly better performance than a standard bubble sort.
Cocktail sort is less than two times faster than bubble sort. Another optimization can be that the algorithm remembers where the last actual swap has been done. In the next iteration, there will be no swaps beyond this limit and the algorithm has shorter passes. Cocktail sort goes bidirectionally, the range of possible swaps, which is the range to be tested, will reduce per pass, thus reducing the overall running time slightly.