A fast, adaptive sorting algorithm