Enhanced C#
Language of your choice: library documentation

Static Public Member Functions  
static MaxHeapInList< T >  AsMaxHeap< T > (this IList< T > list, IComparer< T > compare=null, bool heapify=false) 
Returns a MaxHeapInList wrapper object, which treats the list as a binary maxheap (priority queue). This function assumes that the given list already represents a binary maxheap in which the child nodes of list[x] are list[x*2+1] and list[x*2+2]. If this is not the case, you can either use ToMaxHeap() to make a copy with the heap property, or call Heapify() on the result of this function. More...  
static MaxHeap< T >  ToMaxHeap< T > (this IList< T > list, IComparer< T > compare=null, bool heapify=true) 
Copies the list into a new object with the items arranged as a maxheap (priority queue). Complexity: O(N). More...  
static MinHeapInList< T >  AsMinHeap< T > (this IList< T > list, IComparer< T > compare=null, bool heapify=false) 
Returns a MinHeapInList wrapper object, which treats the list as a binary minheap (priority queue). This function assumes that the given list already represents a binary minheap in which the child nodes of list[x] are list[x*2+1] and list[x*2+2]. If this is not true, you can either use ToMinHeap() to make a copy with the heap property, or call Heapify() on the result of this function. More...  
static MinHeap< T >  ToMinHeap< T > (this IList< T > list, IComparer< T > compare=null, bool heapify=true) 
Copies the list into a new object with the items arranged as a minheap (priority queue). Complexity: O(N). More...  

inlinestatic 
Returns a MaxHeapInList wrapper object, which treats the list as a binary maxheap (priority queue). This function assumes that the given list already represents a binary maxheap in which the child nodes of list[x] are list[x*2+1] and list[x*2+2]. If this is not the case, you can either use ToMaxHeap() to make a copy with the heap property, or call Heapify() on the result of this function.
compare  An object to be used to compare T values. 
heapify  Whether to rearrange items so that they have the heap property. 

inlinestatic 
Returns a MinHeapInList wrapper object, which treats the list as a binary minheap (priority queue). This function assumes that the given list already represents a binary minheap in which the child nodes of list[x] are list[x*2+1] and list[x*2+2]. If this is not true, you can either use ToMinHeap() to make a copy with the heap property, or call Heapify() on the result of this function.
compare  An object to be used to compare T values. 
heapify  Whether to rearrange items so that they have the heap property. 

inlinestatic 
Copies the list into a new object with the items arranged as a maxheap (priority queue). Complexity: O(N).
compare  An object to be used to compare T values. 
heapify  Whether to rearrange items so that they have the heap property. If the items are already arranged with the heap property, you can skip heapification by setting this to false. 

inlinestatic 
Copies the list into a new object with the items arranged as a minheap (priority queue). Complexity: O(N).
compare  An object to be used to compare T values. 
heapify  Whether to rearrange items so that they have the heap property. If the items are already arranged with the heap property, you can skip heapification by setting this to false. 