An extremely wasteful exercise in designing a sorting algorithm.