PriorityQueue<TElement,TPriority> Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
PriorityQueue<TElement,TPriority>() |
Initializes a new instance of the PriorityQueue<TElement,TPriority> class. |
PriorityQueue<TElement,TPriority>(IComparer<TPriority>) |
Initializes a new instance of the PriorityQueue<TElement,TPriority> class with the specified custom priority comparer. |
PriorityQueue<TElement,TPriority>(IEnumerable<ValueTuple<TElement,TPriority>>) |
Initializes a new instance of the PriorityQueue<TElement,TPriority> class that is populated with the specified elements and priorities. |
PriorityQueue<TElement,TPriority>(Int32) |
Initializes a new instance of the PriorityQueue<TElement,TPriority> class with the specified initial capacity. |
PriorityQueue<TElement,TPriority>(IEnumerable<ValueTuple<TElement,TPriority>>, IComparer<TPriority>) |
Initializes a new instance of the PriorityQueue<TElement,TPriority> class that is populated with the specified elements and priorities, and with the specified custom priority comparer. |
PriorityQueue<TElement,TPriority>(Int32, IComparer<TPriority>) |
Initializes a new instance of the PriorityQueue<TElement,TPriority> class with the specified initial capacity and custom priority comparer. |
PriorityQueue<TElement,TPriority>()
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
Initializes a new instance of the PriorityQueue<TElement,TPriority> class.
public:
PriorityQueue();
public PriorityQueue ();
Public Sub New ()
Applies to
PriorityQueue<TElement,TPriority>(IComparer<TPriority>)
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
Initializes a new instance of the PriorityQueue<TElement,TPriority> class with the specified custom priority comparer.
public:
PriorityQueue(System::Collections::Generic::IComparer<TPriority> ^ comparer);
public PriorityQueue (System.Collections.Generic.IComparer<TPriority>? comparer);
new System.Collections.Generic.PriorityQueue<'Element, 'Priority> : System.Collections.Generic.IComparer<'Priority> -> System.Collections.Generic.PriorityQueue<'Element, 'Priority>
Public Sub New (comparer As IComparer(Of TPriority))
Parameters
- comparer
- IComparer<TPriority>
Custom comparer dictating the ordering of elements.
Uses Default if the argument is null
.
Applies to
PriorityQueue<TElement,TPriority>(IEnumerable<ValueTuple<TElement,TPriority>>)
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
Initializes a new instance of the PriorityQueue<TElement,TPriority> class that is populated with the specified elements and priorities.
public:
PriorityQueue(System::Collections::Generic::IEnumerable<ValueTuple<TElement, TPriority>> ^ items);
public PriorityQueue (System.Collections.Generic.IEnumerable<(TElement Element, TPriority Priority)> items);
new System.Collections.Generic.PriorityQueue<'Element, 'Priority> : seq<ValueTuple<'Element, 'Priority>> -> System.Collections.Generic.PriorityQueue<'Element, 'Priority>
Public Sub New (items As IEnumerable(Of ValueTuple(Of TElement, TPriority)))
Parameters
- items
- IEnumerable<ValueTuple<TElement,TPriority>>
The pairs of elements and priorities with which to populate the queue.
Exceptions
The specified items
argument was null
.
Remarks
Constructs the heap using a heapify operation, which is generally faster than enqueuing individual elements sequentially.
Applies to
PriorityQueue<TElement,TPriority>(Int32)
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
Initializes a new instance of the PriorityQueue<TElement,TPriority> class with the specified initial capacity.
public:
PriorityQueue(int initialCapacity);
public PriorityQueue (int initialCapacity);
new System.Collections.Generic.PriorityQueue<'Element, 'Priority> : int -> System.Collections.Generic.PriorityQueue<'Element, 'Priority>
Public Sub New (initialCapacity As Integer)
Parameters
- initialCapacity
- Int32
Initial capacity to allocate in the underlying heap array.
Exceptions
The specified initialCapacity
was negative.
Applies to
PriorityQueue<TElement,TPriority>(IEnumerable<ValueTuple<TElement,TPriority>>, IComparer<TPriority>)
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
Initializes a new instance of the PriorityQueue<TElement,TPriority> class that is populated with the specified elements and priorities, and with the specified custom priority comparer.
public:
PriorityQueue(System::Collections::Generic::IEnumerable<ValueTuple<TElement, TPriority>> ^ items, System::Collections::Generic::IComparer<TPriority> ^ comparer);
public PriorityQueue (System.Collections.Generic.IEnumerable<(TElement Element, TPriority Priority)> items, System.Collections.Generic.IComparer<TPriority>? comparer);
new System.Collections.Generic.PriorityQueue<'Element, 'Priority> : seq<ValueTuple<'Element, 'Priority>> * System.Collections.Generic.IComparer<'Priority> -> System.Collections.Generic.PriorityQueue<'Element, 'Priority>
Public Sub New (items As IEnumerable(Of ValueTuple(Of TElement, TPriority)), comparer As IComparer(Of TPriority))
Parameters
- items
- IEnumerable<ValueTuple<TElement,TPriority>>
The pairs of elements and priorities with which to populate the queue.
- comparer
- IComparer<TPriority>
Custom comparer dictating the ordering of elements.
Uses Default if the argument is null
.
Exceptions
The specified items
argument was null
.
Remarks
Constructs the heap using a heapify operation, which is generally faster than enqueuing individual elements sequentially.
Applies to
PriorityQueue<TElement,TPriority>(Int32, IComparer<TPriority>)
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
- Source:
- PriorityQueue.cs
Initializes a new instance of the PriorityQueue<TElement,TPriority> class with the specified initial capacity and custom priority comparer.
public:
PriorityQueue(int initialCapacity, System::Collections::Generic::IComparer<TPriority> ^ comparer);
public PriorityQueue (int initialCapacity, System.Collections.Generic.IComparer<TPriority>? comparer);
new System.Collections.Generic.PriorityQueue<'Element, 'Priority> : int * System.Collections.Generic.IComparer<'Priority> -> System.Collections.Generic.PriorityQueue<'Element, 'Priority>
Public Sub New (initialCapacity As Integer, comparer As IComparer(Of TPriority))
Parameters
- initialCapacity
- Int32
Initial capacity to allocate in the underlying heap array.
- comparer
- IComparer<TPriority>
Custom comparer dictating the ordering of elements.
Uses Default if the argument is null
.
Exceptions
The specified initialCapacity
was negative.