C++ Standard Template Library (STL) – [Heap]

The Heap data structure is an array that can be viewed as a complete Binary Tree. Each node in the tree corresponds to an element of the array A[]. We already discussed Heap data structure in this – post. However in this post we would learn about, how to build min/max Heaps […]

Heap Sort in C++

The Heapsort algorithm uses Heap data structure to sort an array in O(nlogn) time complexity. It starts by calling Build-Max-Heap.