How to use the bintrees.BinTree function in bintrees

To help you get started, we’ve selected a few bintrees examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / bintrees / bintrees-tests.ts View on Github external
import { BinTree, RBTree } from 'bintrees';

let treeA = new RBTree((a:number, b:number) => a - b);

treeA.insert(5);
treeA.insert(3);
treeA.remove(3);

let treeB = new BinTree((a:string, b:string) => a.length - b.length);

treeB.insert('hi');
treeB.insert('there');
treeB.insert('how');
treeB.insert('are');

bintrees

Binary Search Trees

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis

Popular bintrees functions