This document summarizes the heapify algorithm. The heapify algorithm rearranges a binary tree to maintain the heap property, where the root node is greater than or equal to its children (for a max heap) or less than or equal (for a min heap). It does this by comparing the root node to its children, swapping if needed, and then recursively heapifying the subtree. The complexity of the heapify algorithm is O(log n). Examples are provided of applying the heapify algorithm to transform an example tree into both a min heap and a max heap.