Click or drag to resize

PriorityQueueE Class

An unbounded priority queue based on a priority heap.
Inheritance Hierarchy
SystemObject
  OBCOM.NetSwitchLib.UtilsPriorityQueueE

Namespace:  OBCOM.NetSwitchLib.Utils
Assembly:  OBCOM.NetSwitchLib (in OBCOM.NetSwitchLib.dll) Version: 1.48.7760.35650 (1.48.7760.35650)
Syntax
public sealed class PriorityQueue<E>
where E : class

Type Parameters

E
The type of the elements of the priority queue.

The PriorityQueueE type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyCount
Gets the number of elements in this queue.
Top
Methods
  NameDescription
Public methodAdd
Inserts the specified element into this queue.
Public methodClear
Removes all of the elements from this queue.
Public methodContains
Returns true if this queue contains an element.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodPeek
Retrieves, but does not remove, the head of this queue.
Public methodPoll
Retrieves and removes the head of this queue.
Public methodRemove
Removes a single instance of an element from this queue.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
Priority queue represented as a balanced binary heap: the two children of queue[n] are queue[2*n+1] and queue[2*(n+1)]. The priority queue is ordered by comparator, or by the elements' natural ordering, if comparator is null: For each node n in the heap and each descendant d of n, n <= d. The element with the lowest value is in queue[0], assuming the queue is nonempty.
See Also