Introduction to the Heaps, Their Implementations, and Time Complexity Analysis We have seen about the Graph Algorithms and have already discussed their Time Complexity in our previous article “ Enhancing the Performance of Graph Algorithms — Part 1 ”. Heaps A heap is a type of tree-based data structure that fulfills the heap property. Heap Property: If Q is a child node of P, then key(P) ≥ key (Q). As a result, an element with the greatest key is always in the root node, and such a heap is sometimes referred to as a max-heap . There is, of course, a min-heap . For a min-heap, the parent node will always lesser than the child nodes. The root node will have the lowest element. Let’s see how a min-heap is working As in the definition, the min-heap has to follow the heap property. That is if Q is a child node of P, then key(P) ≤ key (Q). The heap can also be stored in an array, which is a more common approach. Because heap is always a complete binary tree, it can be stored in a small...