Optimized bubble sorts.