flatqueue:非常快速且简单JavaScript优先级队列

时间:2021-02-05 10:00:22
【文件属性】:
文件名称:flatqueue:非常快速且简单JavaScript优先级队列
文件大小:4KB
文件格式:ZIP
更新时间:2021-02-05 10:00:22
javascript algorithms priority-queue data-structures binary-heap 排队 JavaScript中非常快速的二进制堆优先级队列。 与相似,但将队列分别存储为项目ID和其数字优先级值的两个平面数组(无法指定比较器函数)。 这使队列更加有限,但速度快了好几倍。 const q = new FlatQueue ( ) ; for ( let i = 0 ; i < items . length ; i ++ ) { q . push ( i , items [ i ] . value ) ; // push an item by passing its id and value } q . peekValue ( ) ; // top item value
【文件预览】:
flatqueue-master
----.gitignore(49B)
----package.json(795B)
----.travis.yml(38B)
----LICENSE(750B)
----index.js(2KB)
----test.js(1KB)
----README.md(727B)
----bench.js(1KB)

网友评论