Click or drag to resize

PriorityQueue<T> Constructor (Int32, IComparer<T>)

Namespace:  Ookii.Jumbo
Assembly:  Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 2.0.0
Syntax
public PriorityQueue(
	int capacity,
	IComparer<T> comparer
)

Parameters

capacity
Type: System.Int32
The initial number of elements that the PriorityQueue<T> can contain.
comparer
Type: System.Collections.Generic.IComparer<T>
The IComparer<T> implementation to use when comparing elements, or null to use the default Comparer<T> for the type of element.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptioncapacity is less than 0.
Remarks

PriorityQueue<T> requires a comparer implementation to perform key comparisons. If comparer is null, this constructor uses the default generic equality comparer, Default. If type T implements the IComparable<T> generic interface, the default comparer uses that implementation.

This constructor is an O(n) operation, where n is capacity.

See Also