A heap is a binary tree that satisfies the heap property. Heap can be of two types:
Min Heap: The element of each node is greater than or equal to the element at its parent. The minimum value element is at the root.
Max Heap: The element of each node is less than the element at its parent. The maximum value element is at the root.
Max/Min Heap can let us easily know the biggest/smallest element in an array. We can also use add and delete operation to update a heap.
Instructions