rb-interval-tree
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

rb-interval-tree

Balanced red-black interval tree for Javascript

Build Status

Usage

const IntervalTree = require('rb-interval-tree');
const tree = new IntervalTree();

Insertion

tree.insert(4, 7, 'foo');

Search

const results = tree.search(0, 10);

Removal

tree.remove('foo');

Copy

const dup = tree.copy();

Traversal (in order)

tree.visit((value, start, end) => {
    console.log(value, start, end);
});

Package Sidebar

Install

npm i rb-interval-tree

Weekly Downloads

2

Version

2.0.2

License

MIT

Unpacked Size

98.3 kB

Total Files

14

Last publish

Collaborators

  • circlingthesun