constructor Method

Constructor

PriorityQueue<T>(compare: OrderedComparator<T>, clone: CloneFunction<T>shallowClone): PriorityQueue<T>

@note If the criterion which control the result of the compare function changes, then PriorityQueue.sort should be used to reorder the queue according to the new criterion.

Parameter Type Description
compare OrderedComparator<T> The function used to compare values in the queue. If compare(x, y) returns a negative value, then x is placed before y in the queue.
clone CloneFunction<T> The function used to clone a value for insertion onto the queue. The default implementation simply returns its input.

Returns - PriorityQueue<T>

Defined in

Last Updated: 17 December, 2024