Smoothsort
Smoothsort Smoothsort is an adaptive comparison-based sorting algorithm designed by Edsger Dijkstra. It is related to heapsort, but it uses a forest of Leonardo heaps instead of one binary heap. The main advantage is adaptivity. Smoothsort runs in linear time on already sorted or nearly sorted data, while preserving the same worst-case bound as heapsort. Problem Given a sequence $A$ of length $n$, reorder it such that $$ A[0] \le...