The type of elements in the priority queue.
The type of priority values.
Readonly
capacityThe maximum number of elements the collection can hold.
If the collection is unbounded, this will be Infinity
.
Readonly
isPredicate function which determine if one priority is higher than another.
Removes all elements from the collection.
Concatenates the given items to the end of the collection and returns an iterator over the merged items.
This method does not mutate the original collection.
An iterator of the merged items.
Returns the number of elements in the collection.
Removes and returns the item with the highest priority from the priority queue.
The item with the highest priority, or undefined
if the queue is empty.
Returns the item with the highest priority without removing it from the queue.
The item with the highest priority, or undefined
if the queue is empty.
Replaces all the item matching the given predicate in the collection with a new item.
An iterable of the replaced items.
Replaces the first occurence of the item matching the given predicate in the collection with a new item.
true
if the item was found and replaced, false
otherwise.
Interface representing a priority queue data type.
A priority queue is a collection where each item has a priority associated with it. Items with higher priority are served before items with lower priority.