Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | // export default class BTreeNode {
// constructor(isLeaf) {
// /**
// * @type {number[]} list of values in the node
// */
// this.values = [];
// /**
// * @type {boolean} is a leaf
// */
// this.leaf = isLeaf;
// /**
// * @type {BTreeNode[]}
// */
// this.children = [];
// /**
// * Reference to the tree its belong.
// * @type {BTree}
// */
// this.tree = null;
// /**
// * @type {BTreeNode}
// */
// this.parent = null;
// }
//
// /**
// * Number of values
// * @returns {number}
// */
// get n() {
// return this.values.length;
// }
//
// /**
// * Add value
// * @param {number} value
// * @param {number} pos
// */
// addValue(value) {
// if (!value) {
// return;
// }
// let pos = 0;
// while (pos < this.n && this.values[pos] < value) {
// pos++;
// }
// this.values.splice(pos, 0, value);
// }
//
// /**
// * Delete value and return it
// * @param {number} pos position
// * @return {number}
// */
// removeValue(pos) {
// if (pos >= this.n) {
// return null;
// }
// return this.values.splice(pos, 1)[0];
// }
//
// /**
// * Add child node at position pos
// * @param {BTreeNode} node
// * @param {number} pos
// */
// addChild(node, pos) {
// this.children.splice(pos, 0, node);
// // eslint-disable-next-line no-param-reassign
// node.parent = this;
// }
//
// /**
// * Delete node from position and return it
// * @param {number} pos
// * @return {BTreeNode}
// */
// deleteChild(pos) {
// return this.children.splice(pos, 1)[0];
// }
// }
|