This document introduces the heapsort algorithm. Heapsort uses a heap data structure to sort an array in O(n log n) time. It builds a max-heap from the input array in O(n) time using the BUILD-MAX-HEAP procedure. It then repeatedly extracts the maximum element from the heap and inserts it into the sorted portion of the array, maintaining the heap property using MAX-HEAPIFY. This summarizes the key steps and runtime of heapsort.