1.0.0 • Published 3 years ago
@joey-c/priority-queue v1.0.0
priority-queue
ts 优先队列 实现
import PriorityQueue from 'priority-queue';
const priorityQueue = new PriorityQueue<number>({
initial: [3, 9, 6, 5, 10, 2, 7, 1],
priorityFn: (a, b) => a < b,
});
priorityQueue.add(8);
console.log("出队元素:" + priorityQueue.pool());
console.log("出队元素:" + priorityQueue.pool());
1.0.0
3 years ago