This document discusses sorting algorithms and finding medians using heaps. It describes how heapify takes linear time overall to turn an array into a heap. To sort an array using a heap, repeatedly extract the maximum element and place it at the end of the array, requiring O(n log n) time. Finding medians can be done by storing the first half of elements in a max-heap and the second half in a min-heap.