GitHunt
HE

:octopus: d-ary heap data structure library for JavaScript

๐Ÿ™
@heap-data-structure/d-ary-heap

d-ary heap data structure library for JavaScript.
See docs.
Parent is @heap-data-structure.

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
//

License
Version
Tests
Dependencies
GitHub issues
Downloads

Code issues
Code maintainability
Code coverage (cov)
Code technical debt
Documentation
Package size

๐Ÿ“ฐ Description

This package contains a d-ary heap implementation that can be parametrized
with any d > 0.

Languages

JavaScript94.0%Shell6.0%

Contributors

Latest Release

v13.0.0July 28, 2021
GNU Affero General Public License v3.0
Created May 28, 2015
Updated August 15, 2025