sonic-forest
Version:
High-performance (binary) tree and sorted map implementation (AVL, Splay, Radix, Red-Black)
18 lines (17 loc) • 545 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RbMap = exports.RbNode = void 0;
const util_1 = require("./util");
const map_1 = require("../data-types/map");
class RbNode {
constructor(k, v) {
this.k = k;
this.v = v;
this.p = undefined;
this.l = undefined;
this.r = undefined;
this.b = false;
}
}
exports.RbNode = RbNode;
exports.RbMap = (0, map_1.createMap)(RbNode, util_1.insert, util_1.insertLeft, util_1.insertRight, util_1.remove, util_1.print);