TK Memo
Sign in

Heap sort

Computer Science · Algorithms ⁨12⁩ views

Build a max-heap in the row, then swap the root to the end and sift. A heap swap can throw one equal 2 across the other. Time is O of n log n.

heap sortsortingunstable