Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
/ btree-js Public archive

A limited implementation of B-trees in Javascript

License

Notifications You must be signed in to change notification settings

kaa/btree-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

btree-js

Note

This project is no longer maintained

A limited feature implementation of a B-tree index in Javascript. Currently only supporting insert, find and traverse operations.

This is the precursor to implementing the same thing in Solidity for use in ranking of posts in my Ethereum Reddit clone.

Usage

// Initialize index
var ix = new BTree();

// Insert "the answer" with key 42
ix.insert(42,"the answer"); 

// Find value of key 42
var value = ix.find(42); // value == "the answer"

// Insert some more
ix.insert(2,"love is");
ix.insert(99,"always");

// Traverse tree in key order
var values = ix.traverse(0); // value == ["love is", "the answer", "always"]

About

A limited implementation of B-trees in Javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published