All Projects → mourner → bbtree

mourner / bbtree

Licence: other
Self-balancing Binary Search Trees in JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language

Balanced Binary Search Tree experiments

This repo contains several simple balanced binary search tree JavaScript implementations to experiment, benchmark and play with.

Benchmarks contain comparisons with functional-red-black-tree and js_bintrees.

The goal is to create the fastest and at the same time the simplest JS balanced binary search tree library.

Example usage of trees:

// create a tree using a custom compare function
var tree = bbtree(function (a, b) { return a - b; });

// insert items
tree.insert(1, 'foo');
tree.insert(5, {bar: 2});

// find an item
var node = tree.find(3);
console.log(node.key, node.value);

// TODO remove & other methods
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].