https://github.com/heap-data-structure/specification
:mount_fuji: Heap specification for JavaScript
https://github.com/heap-data-structure/specification
agpl data-structures heap javascript specification
Last synced: about 2 months ago
JSON representation
:mount_fuji: Heap specification for JavaScript
- Host: GitHub
- URL: https://github.com/heap-data-structure/specification
- Owner: heap-data-structure
- License: agpl-3.0
- Created: 2015-05-26T20:28:59.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-09-29T19:31:50.000Z (8 months ago)
- Last Synced: 2024-10-02T09:06:26.572Z (8 months ago)
- Topics: agpl, data-structures, heap, javascript, specification
- Language: JavaScript
- Homepage: https://heap-data-structure.github.io/specification
- Size: 4.98 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
:mount_fuji: [@heap-data-structure/specification](https://heap-data-structure.github.io/specification)
==Heap specification library for JavaScript.
See [docs](https://heap-data-structure.github.io/specification).
Parent is [@heap-data-structure](https://github.com/heap-data-structure/about).```js
// eslint-disable-next-line ava/use-test
import ava from 'ava' ;
import * as spec from '@heap-data-structure/specification' ;spec.test(
ava ,
[
[
"DummyHeap" , // Name for the implementation
compare => new spec.DummyHeap(compare) // Return an empty heap using `compare` to order priorities
]
] ,
{
references : true , // Do the implementations maintain references?
length : true , // Do the implementations maintain a `length` property?
lengths : [[0], [1], [16], [17], [31], [32], [33], [63], [64], [65]] ,
lengths1 : [[0], [1], [16], [17], [31], [32], [33], [63], [64], [65]] , // for merge/meld test
lengths2 : [[0], [1], [16], [17], [31], [32], [33], [63], [64], [65]] , // for merge/meld test
}
) ;
```[](https://raw.githubusercontent.com/heap-data-structure/specification/main/LICENSE)
[](https://www.npmjs.org/package/@heap-data-structure/specification)
[](https://github.com/heap-data-structure/specification/actions/workflows/ci.yml?query=branch:main)
[](https://github.com/heap-data-structure/specification/network/dependencies)
[](https://github.com/heap-data-structure/specification/issues)
[](https://www.npmjs.org/package/@heap-data-structure/specification)[](https://codeclimate.com/github/heap-data-structure/specification/issues)
[](https://codeclimate.com/github/heap-data-structure/specification/trends/churn)
[](https://codecov.io/gh/heap-data-structure/specification)
[](https://codeclimate.com/github/heap-data-structure/specification/trends/technical_debt)
[](https://heap-data-structure.github.io/specification/source.html)
[](https://bundlephobia.com/result?p=@heap-data-structure/specification)## :newspaper: Description
This package contains a specification test suite for heap implementations such
as
[@heap-data-structure/d-ary-heap](https://github.com/heap-data-structure/d-ary-heap),
[@heap-data-structure/pairing-heap](https://github.com/heap-data-structure/pairing-heap),
[@heap-data-structure/binomial-heap](https://github.com/heap-data-structure/binomial-heap),
and
[@heap-data-structure/fibonacci-heap](https://github.com/heap-data-structure/fibonacci-heap).## :scroll: Reference
- [Binomial heap](https://www.cs.princeton.edu/~wayne/cs423/lectures/heaps-4up.pdf)
- [Binary heap](https://stackoverflow.com/questions/6531543/efficient-implementation-of-binary-heaps)