data-structures/size-balanced-tree

Size balanced tree is a data structure which is a type of self-balancing binary search tree that use the tree size attribute for re-balancing the tree.
Source:
Example
var SBTree = require('../src/data-structures/size-balanced-tree').SBTree;
var sbTree = new SBTree();

var treeNode = sbTree.push({
  name: 'John',
  surname: 'Smith'
});
sbTree.insert(0, {
  name: 'Pavlo',
  surname: 'Popov'
});
sbTree.insert(1, {
  name: 'Garry',
  surname: 'Fisher'
});
sbTree.insert(0, {
  name: 'Derek',
  surname: 'Anderson'
});

console.log(sbTree.get(0)); // { name: 'Derek', surname: 'Anderson' }