| PriorityQueueT Constructor (IEnumerableT, IComparerT) |
Initializes a new instance of the
PriorityQueueT that contains elements
copied from the specified
IEnumerableT and that uses the specified
IComparerT implementation to compare keys.
Namespace:
Ookii.Jumbo
Assembly:
Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 2.0.0
Syntax public PriorityQueue(
IEnumerable<T> collection,
IComparer<T> comparer
)
Public Sub New (
collection As IEnumerable(Of T),
comparer As IComparer(Of T)
)
public:
PriorityQueue(
IEnumerable<T>^ collection,
IComparer<T>^ comparer
)
new :
collection : IEnumerable<'T> *
comparer : IComparer<'T> -> PriorityQueue
Parameters
- collection
- Type: System.Collections.GenericIEnumerableT
The IEnumerableT whose elements are copied to
the new PriorityQueueT. - 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 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 the number of elements
in collection.
See Also