A heap is a balanced tree which has some special properties. There are two variations of heap: MinHeap and MaxHeap. In a MinHeap, the root node is lesser than all the child nodes. MaxHeap has the maximum value in the root node.
Heap is not available in the .NET framework. The best implementation that I could find for a MinHeap is a blog post from Allan.…