Click or drag to resize

PriorityQueueT Constructor (Int32, IComparerT)

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

Parameters

capacity
Type: SystemInt32
The initial number of elements that the PriorityQueueT can contain.
comparer
Type: System.Collections.GenericIComparerT
The IComparerT implementation to use when comparing elements, or to use the default ComparerT for the type of element.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptioncapacity is less than 0.
Remarks

PriorityQueueT requires a comparer implementation to perform key comparisons. If comparer is , this constructor uses the default generic equality comparer, Default. If type T implements the IComparableT generic interface, the default comparer uses that implementation.

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

See Also