Microsoft.Samples.Collections

Heap.Extract Method 

Extract returns the highest value object from the heap

public virtual object Extract();

Return Value

The highest value object from the heap

Remarks

The highest value is defined as the highest that would be returned by sorting using the IComparer provided at construction time or else the system default Comparer. This implementation uses the locale-sensitive default comparer.

Exceptions

Exception TypeCondition
InvalidOperationExceptionThrown when the Heap is empty.

See Also

Heap Class | Microsoft.Samples.Collections Namespace