This document discusses heaps and priority queues. It defines a min-heap as a complete binary tree where the root value is the smallest and its subtrees are also heaps. This property allows a min-heap to efficiently implement a priority queue, where the smallest element can always be found at the root. Elements can be inserted in O(log n) time by adding to the end and percolating up, and removed in O(log n) time by removing the root and percolating down the replacement. This makes heap-based priority queues more efficient than other implementations like sorted lists. Heapsort is also discussed, which sorts in O(n log n) time by building a heap and repeatedly removing elements