1 | {"version":3,"file":"tree-9f3c8837.cjs","sources":["../tree.js"],"sourcesContent":["/**\n * Red-black-tree implementation.\n *\n * @module tree\n */\n// @ts-nocheck TODO: remove or refactor this file\n\nconst rotate = (tree, parent, newParent, n) => {\n if (parent === null) {\n tree.root = newParent\n newParent._parent = null\n } else if (parent.left === n) {\n parent.left = newParent\n } else if (parent.right === n) {\n parent.right = newParent\n } else {\n throw new Error('The elements are wrongly connected!')\n }\n}\n\n/**\n * @template V\n */\nclass N {\n /**\n * A created node is always red!\n *\n * @param {V} val\n */\n constructor (val) {\n this.val = val\n this.color = true\n this._left = null\n this._right = null\n this._parent = null\n }\n\n isRed () { return this.color }\n isBlack () { return !this.color }\n redden () { this.color = true; return this }\n blacken () { this.color = false; return this }\n get grandparent () {\n return this.parent.parent\n }\n\n get parent () {\n return this._parent\n }\n\n get sibling () {\n return (this === this.parent.left)\n ? this.parent.right\n : this.parent.left\n }\n\n get left () {\n return this._left\n }\n\n get right () {\n return this._right\n }\n\n set left (n) {\n if (n !== null) {\n n._parent = this\n }\n this._left = n\n }\n\n set right (n) {\n if (n !== null) {\n n._parent = this\n }\n this._right = n\n }\n\n rotateLeft (tree) {\n const parent = this.parent\n const newParent = this.right\n const newRight = this.right.left\n newParent.left = this\n this.right = newRight\n rotate(tree, parent, newParent, this)\n }\n\n next () {\n if (this.right !== null) {\n // search the most left node in the right tree\n let o = this.right\n while (o.left !== null) {\n o = o.left\n }\n return o\n } else {\n let p = this\n while (p.parent !== null && p !== p.parent.left) {\n p = p.parent\n }\n return p.parent\n }\n }\n\n prev () {\n if (this.left !== null) {\n // search the most right node in the left tree\n let o = this.left\n while (o.right !== null) {\n o = o.right\n }\n return o\n } else {\n let p = this\n while (p.parent !== null && p !== p.parent.right) {\n p = p.parent\n }\n return p.parent\n }\n }\n\n rotateRight (tree) {\n const parent = this.parent\n const newParent = this.left\n const newLeft = this.left.right\n newParent.right = this\n this.left = newLeft\n rotate(tree, parent, newParent, this)\n }\n\n getUncle () {\n // we can assume that grandparent exists when this is called!\n if (this.parent === this.parent.parent.left) {\n return this.parent.parent.right\n } else {\n return this.parent.parent.left\n }\n }\n}\n\nconst isBlack = node =>\n node !== null ? node.isBlack() : true\n\nconst isRed = (node) =>\n node !== null ? node.isRed() : false\n\n/**\n * This is a Red Black Tree implementation\n *\n * @template K,V\n */\nexport class Tree {\n constructor () {\n this.root = null\n this.length = 0\n }\n\n /**\n * @param {K} id\n */\n findNext (id) {\n const nextID = id.clone()\n nextID.clock += 1\n return this.findWithLowerBound(nextID)\n }\n\n /**\n * @param {K} id\n */\n findPrev (id) {\n const prevID = id.clone()\n prevID.clock -= 1\n return this.findWithUpperBound(prevID)\n }\n\n /**\n * @param {K} from\n */\n findNodeWithLowerBound (from) {\n let o = this.root\n if (o === null) {\n return null\n } else {\n while (true) {\n if (from === null || (from.lessThan(o.val._id) && o.left !== null)) {\n // o is included in the bound\n // try to find an element that is closer to the bound\n o = o.left\n } else if (from !== null && o.val._id.lessThan(from)) {\n // o is not within the bound, maybe one of the right elements is..\n if (o.right !== null) {\n o = o.right\n } else {\n // there is no right element. Search for the next bigger element,\n // this should be within the bounds\n return o.next()\n }\n } else {\n return o\n }\n }\n }\n }\n\n /**\n * @param {K} to\n */\n findNodeWithUpperBound (to) {\n if (to === undefined) {\n throw new Error('You must define from!')\n }\n let o = this.root\n if (o === null) {\n return null\n } else {\n while (true) {\n if ((to === null || o.val._id.lessThan(to)) && o.right !== null) {\n // o is included in the bound\n // try to find an element that is closer to the bound\n o = o.right\n } else if (to !== null && to.lessThan(o.val._id)) {\n // o is not within the bound, maybe one of the left elements is..\n if (o.left !== null) {\n o = o.left\n } else {\n // there is no left element. Search for the prev smaller element,\n // this should be within the bounds\n return o.prev()\n }\n } else {\n return o\n }\n }\n }\n }\n\n /**\n * @return {V}\n */\n findSmallestNode () {\n let o = this.root\n while (o != null && o.left != null) {\n o = o.left\n }\n return o\n }\n\n /**\n * @param {K} from\n * @return {V}\n */\n findWithLowerBound (from) {\n const n = this.findNodeWithLowerBound(from)\n return n == null ? null : n.val\n }\n\n /**\n * @param {K} to\n * @return {V}\n */\n findWithUpperBound (to) {\n const n = this.findNodeWithUpperBound(to)\n return n == null ? null : n.val\n }\n\n /**\n * @param {K} from\n * @param {V} from\n * @param {function(V):void} f\n */\n iterate (from, to, f) {\n let o\n if (from === null) {\n o = this.findSmallestNode()\n } else {\n o = this.findNodeWithLowerBound(from)\n }\n while (\n o !== null &&\n (\n to === null || // eslint-disable-line no-unmodified-loop-condition\n o.val._id.lessThan(to) ||\n o.val._id.equals(to)\n )\n ) {\n f(o.val)\n o = o.next()\n }\n }\n\n /**\n * @param {K} id\n * @return {V|null}\n */\n find (id) {\n const n = this.findNode(id)\n if (n !== null) {\n return n.val\n } else {\n return null\n }\n }\n\n /**\n * @param {K} id\n * @return {N<V>|null}\n */\n findNode (id) {\n let o = this.root\n if (o === null) {\n return null\n } else {\n while (true) {\n if (o === null) {\n return null\n }\n if (id.lessThan(o.val._id)) {\n o = o.left\n } else if (o.val._id.lessThan(id)) {\n o = o.right\n } else {\n return o\n }\n }\n }\n }\n\n /**\n * @param {K} id\n */\n delete (id) {\n let d = this.findNode(id)\n if (d == null) {\n // throw new Error('Element does not exist!')\n return\n }\n this.length--\n if (d.left !== null && d.right !== null) {\n // switch d with the greates element in the left subtree.\n // o should have at most one child.\n let o = d.left\n // find\n while (o.right !== null) {\n o = o.right\n }\n // switch\n d.val = o.val\n d = o\n }\n // d has at most one child\n // let n be the node that replaces d\n let isFakeChild\n let child = d.left || d.right\n if (child === null) {\n isFakeChild = true\n child = new N(null)\n child.blacken()\n d.right = child\n } else {\n isFakeChild = false\n }\n\n if (d.parent === null) {\n if (!isFakeChild) {\n this.root = child\n child.blacken()\n child._parent = null\n } else {\n this.root = null\n }\n return\n } else if (d.parent.left === d) {\n d.parent.left = child\n } else if (d.parent.right === d) {\n d.parent.right = child\n } else {\n throw new Error('Impossible!')\n }\n if (d.isBlack()) {\n if (child.isRed()) {\n child.blacken()\n } else {\n this._fixDelete(child)\n }\n }\n this.root.blacken()\n if (isFakeChild) {\n if (child.parent.left === child) {\n child.parent.left = null\n } else if (child.parent.right === child) {\n child.parent.right = null\n } else {\n throw new Error('Impossible #3')\n }\n }\n }\n\n _fixDelete (n) {\n if (n.parent === null) {\n // this can only be called after the first iteration of fixDelete.\n return\n }\n // d was already replaced by the child\n // d is not the root\n // d and child are black\n let sibling = n.sibling\n if (isRed(sibling)) {\n // make sibling the grandfather\n n.parent.redden()\n sibling.blacken()\n if (n === n.parent.left) {\n n.parent.rotateLeft(this)\n } else if (n === n.parent.right) {\n n.parent.rotateRight(this)\n } else {\n throw new Error('Impossible #2')\n }\n sibling = n.sibling\n }\n // parent, sibling, and children of n are black\n if (n.parent.isBlack() &&\n sibling.isBlack() &&\n isBlack(sibling.left) &&\n isBlack(sibling.right)\n ) {\n sibling.redden()\n this._fixDelete(n.parent)\n } else if (n.parent.isRed() &&\n sibling.isBlack() &&\n isBlack(sibling.left) &&\n isBlack(sibling.right)\n ) {\n sibling.redden()\n n.parent.blacken()\n } else {\n if (n === n.parent.left &&\n sibling.isBlack() &&\n isRed(sibling.left) &&\n isBlack(sibling.right)\n ) {\n sibling.redden()\n sibling.left.blacken()\n sibling.rotateRight(this)\n sibling = n.sibling\n } else if (n === n.parent.right &&\n sibling.isBlack() &&\n isRed(sibling.right) &&\n isBlack(sibling.left)\n ) {\n sibling.redden()\n sibling.right.blacken()\n sibling.rotateLeft(this)\n sibling = n.sibling\n }\n sibling.color = n.parent.color\n n.parent.blacken()\n if (n === n.parent.left) {\n sibling.right.blacken()\n n.parent.rotateLeft(this)\n } else {\n sibling.left.blacken()\n n.parent.rotateRight(this)\n }\n }\n }\n\n put (v) {\n const node = new N(v)\n if (this.root !== null) {\n let p = this.root // p abbrev. parent\n while (true) {\n if (node.val._id.lessThan(p.val._id)) {\n if (p.left === null) {\n p.left = node\n break\n } else {\n p = p.left\n }\n } else if (p.val._id.lessThan(node.val._id)) {\n if (p.right === null) {\n p.right = node\n break\n } else {\n p = p.right\n }\n } else {\n p.val = node.val\n return p\n }\n }\n this._fixInsert(node)\n } else {\n this.root = node\n }\n this.length++\n this.root.blacken()\n return node\n }\n\n _fixInsert (n) {\n if (n.parent === null) {\n n.blacken()\n return\n } else if (n.parent.isBlack()) {\n return\n }\n const uncle = n.getUncle()\n if (uncle !== null && uncle.isRed()) {\n // Note: parent: red, uncle: red\n n.parent.blacken()\n uncle.blacken()\n n.grandparent.redden()\n this._fixInsert(n.grandparent)\n } else {\n // Note: parent: red, uncle: black or null\n // Now we transform the tree in such a way that\n // either of these holds:\n // 1) grandparent.left.isRed\n // and grandparent.left.left.isRed\n // 2) grandparent.right.isRed\n // and grandparent.right.right.isRed\n if (n === n.parent.right && n.parent === n.grandparent.left) {\n n.parent.rotateLeft(this)\n // Since we rotated and want to use the previous\n // cases, we need to set n in such a way that\n // n.parent.isRed again\n n = n.left\n } else if (n === n.parent.left && n.parent === n.grandparent.right) {\n n.parent.rotateRight(this)\n // see above\n n = n.right\n }\n // Case 1) or 2) hold from here on.\n // Now traverse grandparent, make parent a black node\n // on the highest level which holds two red nodes.\n n.parent.blacken()\n n.grandparent.redden()\n if (n === n.parent.left) {\n // Case 1\n n.grandparent.rotateRight(this)\n } else {\n // Case 2\n n.grandparent.rotateLeft(this)\n }\n }\n }\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,KAAK;AAC/C,EAAE,IAAI,MAAM,KAAK,IAAI,EAAE;AACvB,IAAI,IAAI,CAAC,IAAI,GAAG,UAAS;AACzB,IAAI,SAAS,CAAC,OAAO,GAAG,KAAI;AAC5B,GAAG,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE;AAChC,IAAI,MAAM,CAAC,IAAI,GAAG,UAAS;AAC3B,GAAG,MAAM,IAAI,MAAM,CAAC,KAAK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