Heap Sort is a comparison-based sorting algorithm to create a sorted array. It is similar to selection sort where we first find the maximum element from array and place it at the end. We repeat this process for each element in the given array. Heap Sort is based on Binary Heap data structure. In this program we will be sorting the given array in ascending order. Read the rest of this entry »
Heap data structure is widely use in software languages like C, C++, Python, Java etc. There are different type of heaps like Binary Heap, Fibonacci Heap, Binomial Heap and so on. Out of these, Binary Heap is more popular and others are variations of it. Following are the properties of Binary Heap.
- Binary tree property: It’s a complete tree i.e All levels are completely filled except last levels which has all keys as left as possible.
- Binary Heap is either a Max heap or Min Heap.