This document discusses heap data structures and their application in sorting. It defines heaps as nearly complete binary trees that satisfy the heap property - for any node x, the parent is greater than or equal to x in a max-heap and less than or equal in a min-heap. Heaps can be represented using arrays in a compact manner. Heapsort uses a max-heap to sort an array by building a max-heap and repeatedly swapping the root with the last element.
Related topics: