【文件属性】:
文件名称:tinyqueue:JavaScript中最小和最简单的优先级队列
文件大小:5KB
文件格式:ZIP
更新时间:2021-02-04 22:06:57
javascript algorithm data-structure priority-queue binary-heap
小队列
JavaScript中最小和最简单的二进制堆优先级队列。
// create an empty priority queue
var queue = new TinyQueue ( ) ;
// add some items
queue . push ( 7 ) ;
queue . push ( 5 ) ;
queue . push ( 10 ) ;
// remove the top item
var top = queue . pop ( ) ; // returns 5
// return the top item (without removal)
top = queue .
【文件预览】:
tinyqueue-master
----.gitignore(59B)
----package.json(1KB)
----.travis.yml(46B)
----LICENSE(750B)
----index.js(2KB)
----test.js(1KB)
----rollup.config.js(382B)
----README.md(1KB)
----bench.js(442B)
----index.d.ts(280B)