UNPKG

sonic-forest

Version:

High-performance (binary) tree and sorted map implementation (AVL, Splay, Radix, Red-Black)

18 lines (17 loc) 549 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AvlMap = exports.AvlNode = void 0; const util_1 = require("./util"); const map_1 = require("../data-types/map"); class AvlNode { constructor(k, v) { this.k = k; this.v = v; this.p = undefined; this.l = undefined; this.r = undefined; this.bf = 0; } } exports.AvlNode = AvlNode; exports.AvlMap = (0, map_1.createMap)(AvlNode, util_1.insert, util_1.insertLeft, util_1.insertRight, util_1.remove, util_1.print);