@heap-data-structure/d-ary-heap
v13.0.0
Published
d-ary heap data structure library for JavaScript
Downloads
12
Readme
:octopus: @heap-data-structure/d-ary-heap
d
-ary heap data structure library for JavaScript.
See docs.
Parent is @heap-data-structure.
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
//
:newspaper: Description
This package contains a d
-ary heap implementation that can be parametrized
with any d > 0
.