Click or drag to resize

SimplePriorityQueueTElement Class

Simple priority queue which uses a simple list for storing the elements. Inserts are very fast, O(1), but lookups are done in linear time, O(n).
Inheritance Hierarchy
SystemObject
  SD.Tools.Algorithmia.PriorityQueuesPriorityQueueBaseTElement
    SD.Tools.Algorithmia.PriorityQueuesSimplePriorityQueueTElement

Namespace:  SD.Tools.Algorithmia.PriorityQueues
Assembly:  SD.Tools.Algorithmia (in SD.Tools.Algorithmia.dll) Version: 1.4.0.0 (1.4.19.0711)
Syntax
public class SimplePriorityQueue<TElement> : PriorityQueueBase<TElement>

Type Parameters

TElement
The type of the elements in this queue

The SimplePriorityQueueTElement type exposes the following members.

Constructors
  NameDescription
Public methodSimplePriorityQueueTElement
Initializes a new instance of the SimplePriorityQueueTElement class.
Top
Properties
Methods
  NameDescription
Public methodAdd
Adds the specified element to the queue
(Overrides PriorityQueueBaseTElementAdd(TElement).)
Public methodClear
Clears the queue.
(Overrides PriorityQueueBaseTElementClear.)
Public methodContains
Determines whether the queue contains the element specified
(Overrides PriorityQueueBaseTElementContains(TElement).)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodGetEnumerator
Gets the enumerator for this queue
(Overrides PriorityQueueBaseTElementGetEnumerator.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPeek
Peeks at the first element of the queue (the one with the highest priority, according to the priority comparison) and returns that element without removing it
(Overrides PriorityQueueBaseTElementPeek.)
Public methodRemove
Removes the first element from the queue, if the queue isn't empty.
(Overrides PriorityQueueBaseTElementRemove.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Explicit Interface Implementations
Remarks
If you store value types in this queue, be aware that Peek() and Remove() on an empty queue will return the default value for the value type used, e.g. 0 for a priority queue with Int32 values.
See Also