array-to-btree-object

1.0.1 • Public • Published

array-to-btree-object

This module takes a list and a comparison function, and returns an object that looks kinda like this:


{
  data: 'the-item-in-your-list',
  left: {
    data: 'another-item-in-your-list'
  },
  right: {
    data: 'another-item'
  }
}

The comparison function looks kinda like this:


function (item, treeItem) {
   return item > treeItem;
}


/array-to-btree-object/

    Package Sidebar

    Install

    npm i array-to-btree-object

    Weekly Downloads

    2

    Version

    1.0.1

    License

    ISC

    Last publish

    Collaborators

    • jkatsnelson