heaps learning objective heap is specialized tree-based data structure there are several variants of heaps which are the prototypical implementations of priority queues we have already discussed priority queues in heaps are also crucial in several efficient graph algorithms in this we will discuss three types of heaps--binary heapsbinomial heapsand fibonacci heaps binary heaps binary heap is complete binary tree in which every node satisfies the heap property which states thatif is child of athen key( >key(bthis implies that elements at every node will be either greater than or equal to the element at its left and right child thusthe root node has the highest key value in the heap such heap is commonly known as max-heap alternativelyelements at every node will be either less than or equal to the element at its left and right child thusthe root has the lowest key value such heap is called min-heap figure shows binary min heap and binary max heap the properties of binary heaps are given as followsmin heap max heap since heap is defined as complete figure binary heaps binary treeall its elements can be stored