Let's write an inplace Heapsort in Swift
Using only extensions, learn how to implement a inplace heapsort, and order your lists in O(n log n).
3 min readFeb 19, 2020
I was really interested on this problem of sorting elements. Sorting with heapsort is fast! But it has a big problem: conventionally you have to build a heap to use a heap sort. In a real world usually you don't have a heap…