Heaps
Heap is a kind of data structures based on complete tree principle. By definition, a complete binary search tree of N levels has at least 2^N-1 nodes in it. Heap is nearly complete tree. Heap maintains a property called as heap property which holds across all nodes of the heap.There are two kinds of heaps we frequently deal with :
Max Heap : It maintains the property that every parent node is greater than its children. Root of the max heap is greatest element.
Min Heap : It maintains the property that every parent node is less than its children. Root of the min heap is least element.







.jpg)


