UNPKG

@gabrielrufino/cube

Version:

Data structures made in Typescript

22 lines (21 loc) 749 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var BinarySearchTreeNode = /** @class */ (function () { function BinarySearchTreeNode(value) { this.left = null; this.right = null; this.value = value; this.left = null; this.right = null; } BinarySearchTreeNode.prototype[Symbol.toPrimitive] = function (type) { var primitives = { default: true, number: 1 + (this.left ? 1 : 0) + (this.right ? 1 : 0), string: "[".concat(this.left, "] <= (").concat(this.value, ") => [").concat(this.right, "]"), }; return primitives[type]; }; return BinarySearchTreeNode; }()); exports.default = BinarySearchTreeNode;