@joey-c/priority-queue
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

priority-queue

codecov

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());

Readme

Keywords

Package Sidebar

Install

npm i @joey-c/priority-queue

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

6.77 kB

Total Files

5

Last publish

Collaborators

  • joeyczz