https://github.com/heap-data-structure/d-ary-heap
:octopus: d-ary heap data structure library for JavaScript
https://github.com/heap-data-structure/d-ary-heap
agpl binary-heap computer-science d-ary-heap data-structures heaps javascript worst-case
Last synced: 3 months ago
JSON representation
:octopus: d-ary heap data structure library for JavaScript
- Host: GitHub
- URL: https://github.com/heap-data-structure/d-ary-heap
- Owner: heap-data-structure
- License: agpl-3.0
- Created: 2015-05-28T10:17:03.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-10-11T01:38:55.000Z (8 months ago)
- Last Synced: 2024-10-14T09:16:57.589Z (8 months ago)
- Topics: agpl, binary-heap, computer-science, d-ary-heap, data-structures, heaps, javascript, worst-case
- Language: JavaScript
- Homepage: https://heap-data-structure.github.io/d-ary-heap
- Size: 4.81 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
:octopus:
[@heap-data-structure/d-ary-heap](https://heap-data-structure.github.io/d-ary-heap)
==
![]()
`d`-ary heap data structure library for JavaScript.
See [docs](https://heap-data-structure.github.io/d-ary-heap).
Parent is [@heap-data-structure](https://github.com/heap-data-structure/about).```js
import {_calloc} from '@array-like/alloc';
const calloc = _calloc(Int32Array);
const array = calloc(10000);import {iota} from '@array-like/fill';
iota(array, 0, array.length, 0);import {shuffle} from '@randomized/random';
shuffle(array, 0, array.length);import {swap} from '@array-like/swap';
import {increasing} from '@total-order/primitive';
import {makeheap} from '@heap-data-structure/d-ary-heap';
makeheap( 2 , increasing , swap , array , 0 , array.length ) ;
// ^ ^ ^ ^ ^ ^
// arity ordering swap input [left , right[
// method
//import {DAryHeap} from '@heap-data-structure/d-ary-heap';
let heap = new DAryHeap( 2 , increasing ) ;
// ^ ^
// arity ordering
//
```[](https://raw.githubusercontent.com/heap-data-structure/d-ary-heap/main/LICENSE)
[](https://www.npmjs.org/package/@heap-data-structure/d-ary-heap)
[](https://github.com/heap-data-structure/d-ary-heap/actions/workflows/ci.yml?query=branch:main)
[](https://github.com/heap-data-structure/d-ary-heap/network/dependencies)
[](https://github.com/heap-data-structure/d-ary-heap/issues)
[](https://www.npmjs.org/package/@heap-data-structure/d-ary-heap)[](https://codeclimate.com/github/heap-data-structure/d-ary-heap/issues)
[](https://codeclimate.com/github/heap-data-structure/d-ary-heap/trends/churn)
[](https://codecov.io/gh/heap-data-structure/d-ary-heap)
[](https://codeclimate.com/github/heap-data-structure/d-ary-heap/trends/technical_debt)
[](https://heap-data-structure.github.io/d-ary-heap/source.html)
[](https://bundlephobia.com/result?p=@heap-data-structure/d-ary-heap)## :newspaper: Description
This package contains a `d`-ary heap implementation that can be parametrized
with any `d > 0`.