8000 Created BTree and BTreeNode classes and added constructors · hariv/javascript-algorithms@0b195c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b195c8

Browse files
committed
Created BTree and BTreeNode classes and added constructors
1 parent f0c09ac commit 0b195c8

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default class BTree {
2+
constructor(degree = 0) {
3+
this.root = null;
4+
this.degree = degree;
5+
}
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default class BTreeNode {
2+
constructor(degree = 0, isLeaf = true) {
3+
this.degree = degree;
4+
this.isLeaf = isLeaf;
5+
this.keys = new Array((2 * this.degree) - 1);
6+
this.children = new Array(2 * this.degree);
7+
this.numKeys = 0;
8+
}
9+
}

src/data-structures/tree/b-tree/README.md

Whitespace-only changes.

0 commit comments

Comments
 (0)
0