sorted queue:基于数组支持的二进制堆的排序队列 源码
排序队列 基于数组支持的二进制堆的排序队列。 安装 $ npm install --save sorted-queue 用法 import { SortedQueue } from "sorted-queue" ; const queue = new SortedQueue ( ) ; // `queue.push()` adds a value to the queue and returns an object // `item` with the `item.value` set to the pushed value. queue . push ( 1 ) ; // { value: 1, ... } queue . push ( - 1 ) ; // { value: -1, ... } queue . push ( 0 ) ; // {
下载地址
用户评论