To compare different elements from the queue, a special comparator function is used, which has the same API as
the native comparator Array.prototype.sort. To provide a comparator, use the structure constructor.
importOrderedQueuefrom'core/queue/order';
const queue = newOrderedQueue<number>((a, b) =>a - b);
core/queue/order
This module provides a class to organize an ordered Queue data structure. See
core/queue
for more information.Usage
Providing a comparator
To compare different elements from the queue, a special comparator function is used, which has the same API as the native comparator
Array.prototype.sort
. To provide a comparator, use the structure constructor.