This is a c# implementation of Priority Heap. The top of heap is biggest element, but you can easily change code to small priority heap.