Skip to content

mourner/bbtree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Self-balancing Binary Search Trees in JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published