01How it works
Bubble sort that reverses direction each pass — left-to-right to bubble the maximum up, then right-to-left to sink the minimum down. Small "turtle" values trapped near the back move toward the front twice as fast as in plain bubble sort.