Click or drag to resize
SimplePriorityQueue<TElement> 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
System.Object
  SD.Tools.Algorithmia.PriorityQueues.PriorityQueueBase<TElement>
    SD.Tools.Algorithmia.PriorityQueues.SimplePriorityQueue<TElement>

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

Type Parameters

TElement
The type of the elements in this queue

The SimplePriorityQueue< TElement> type exposes the following members.

Constructors
  NameDescription
Public methodSimplePriorityQueue<TElement>
Initializes a new instance of the SimplePriorityQueue< TElement> class.
Top
Properties
Methods
  NameDescription
Public methodAdd
Adds the specified element to the queue
(Overrides PriorityQueueBase<TElement>.Add(TElement).)
Public methodClear
Clears the queue.
(Overrides PriorityQueueBase<TElement>.Clear().)
Public methodContains
Determines whether the queue contains the element specified
(Overrides PriorityQueueBase<TElement>.Contains(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 PriorityQueueBase<TElement>.GetEnumerator().)
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 PriorityQueueBase<TElement>.Peek().)
Public methodRemove
Removes the first element from the queue, if the queue isn't empty.
(Overrides PriorityQueueBase<TElement>.Remove().)
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