The following illustrates the difference between max heap and min-heap. Min Heap - In a min-heap, the key of the root node must be less than or equal to the keys of its children node. It uses ascending priority. The node with the smallest key is the priority. The smallest element is popped before any other element. Max Heap - In a max heap, the key of the root node must be greater than or equal to the key of its children’s nodes. It uses descending priority. The node with the largest key is the priority. The largest element is popped before any other element.