Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 515 Bytes

README.md

File metadata and controls

33 lines (28 loc) · 515 Bytes

Bplustree typescript

Usage

const compareFunc = (n1: number, n2: number) => {
  if (n1 < n2) {
    return -1;
  }
  if (n1 === n2) {
    return 0;
  }

  return 1;
};

const bPlusTreeOrder = 4;
const bTree = new BPlusTree<number>(bPlusTreeOrder, compareFunc, [1,2,3,4,5,6]);

bTree.insert(7);
bTree.insert(8);
bTree.delete(1);
bTree.delete(2);

Test

<!-- spec test -->
yarn test
<!-- performance test -->
yarn test:perf

Demo

B+tree visualization