![]() |
Satsuma
a delicious .NET graph library
|
A heap-based no-duplicates priority queue implementation. More...
Public Member Functions | |
| void | Clear () |
| Reverts the object to its default state. More... | |
| bool | Contains (TElement element) |
| Returns whether the specified element is in the priority queue. More... | |
| TElement | Peek () |
| Returns the most prioritized element (that is, which has the lowest priority). More... | |
| TElement | Peek (out TPriority priority) |
| Returns the most prioritized element (that is, which has the lowest priority) and its priority. More... | |
| bool | Pop () |
| Removes the most prioritized element from the queue, if it is not empty. More... | |
| bool | Remove (TElement element) |
| Removes a certain element from the queue, if present. More... | |
| bool | TryGetPriority (TElement element, out TPriority priority) |
| Gets the priority of an element without throwing an exception. More... | |
Properties | |
| int | Count [get] |
| IEnumerable< KeyValuePair < TElement, TPriority > > | Items [get] |
| TPriority | this[TElement element] [get, set] |
A heap-based no-duplicates priority queue implementation.
| TPriority | : | IComparable<TPriority> |
Definition at line 67 of file PriorityQueue.cs.
| void Satsuma.PriorityQueue< TElement, TPriority >.Clear | ( | ) |
Reverts the object to its default state.
Implements Satsuma.IClearable.
Definition at line 74 of file PriorityQueue.cs.
| bool Satsuma.PriorityQueue< TElement, TPriority >.Contains | ( | TElement | element | ) |
Returns whether the specified element is in the priority queue.
Implements Satsuma.IReadOnlyPriorityQueue< TElement, TPriority >.
Definition at line 124 of file PriorityQueue.cs.
| TElement Satsuma.PriorityQueue< TElement, TPriority >.Peek | ( | ) |
Returns the most prioritized element (that is, which has the lowest priority).
Implements Satsuma.IReadOnlyPriorityQueue< TElement, TPriority >.
Definition at line 177 of file PriorityQueue.cs.
| TElement Satsuma.PriorityQueue< TElement, TPriority >.Peek | ( | out TPriority | priority | ) |
Returns the most prioritized element (that is, which has the lowest priority) and its priority.
Implements Satsuma.IReadOnlyPriorityQueue< TElement, TPriority >.
Definition at line 182 of file PriorityQueue.cs.
| bool Satsuma.PriorityQueue< TElement, TPriority >.Pop | ( | ) |
Removes the most prioritized element from the queue, if it is not empty.
true if an element could be removed, i.e. the queue was not empty. Implements Satsuma.IPriorityQueue< TElement, TPriority >.
Definition at line 188 of file PriorityQueue.cs.
| bool Satsuma.PriorityQueue< TElement, TPriority >.Remove | ( | TElement | element | ) |
Removes a certain element from the queue, if present.
true if the given element was present in the queue. Implements Satsuma.IPriorityQueue< TElement, TPriority >.
Definition at line 169 of file PriorityQueue.cs.
| bool Satsuma.PriorityQueue< TElement, TPriority >.TryGetPriority | ( | TElement | element, |
| out TPriority | priority | ||
| ) |
Gets the priority of an element without throwing an exception.
| priority | Becomes default(P) if the element is not in the queue, and the priority of the element otherwise. |
true if the specified element is in the priority queue. Implements Satsuma.IReadOnlyPriorityQueue< TElement, TPriority >.
Definition at line 129 of file PriorityQueue.cs.
|
get |
Definition at line 82 of file PriorityQueue.cs.
|
get |
Definition at line 87 of file PriorityQueue.cs.
|
getset |
Definition at line 96 of file PriorityQueue.cs.
1.8.3.1