mybinaryheap

    1.0.9 • Public • Published

    BinaryHeap

    This is a simple BinaryHeap heap Implementation in nodejs, without dependencies

    Functions Average Worst case
    push O(1) O(log n)
    lower O(1) O(1)

    🗃️Pre-Requisites

    🛠️ Usage

    let BinaryHeap = require("mybinaryheap");
    
    let binaryHeap = new BinaryHeap(2); // limit is set to 2 elements
    binaryHeap.push(2);
    binaryHeap.push(1);
    binaryHeap.push(3);
    console.log(binaryHeap.lower()); //  "2"
    

    Contributing

    ⚠️ Tests

    npm install
    npm run test

    🗃️ Docs

    npm run doc

    =]

    Install

    npm i mybinaryheap

    DownloadsWeekly Downloads

    11

    Version

    1.0.9

    License

    ISC

    Unpacked Size

    4.1 kB

    Total Files

    3

    Last publish

    Collaborators

    • bouldeterre