Initial commit

This commit is contained in:
Brian McGonagill 2026-03-18 09:02:21 -05:00
commit b3a51a4115
10336 changed files with 2381973 additions and 0 deletions

View file

@ -0,0 +1,50 @@
/** @internal */
export const Color = {
Red: 0,
Black: 1 << 0
};
/** @internal */
export const clone = ({
color,
count,
key,
left,
right,
value
}) => ({
color,
key,
value,
left,
right,
count
});
/** @internal */
export function swap(n, v) {
n.key = v.key;
n.value = v.value;
n.left = v.left;
n.right = v.right;
n.color = v.color;
n.count = v.count;
}
/** @internal */
export const repaint = ({
count,
key,
left,
right,
value
}, color) => ({
color,
key,
value,
left,
right,
count
});
/** @internal */
export const recount = node => {
node.count = 1 + (node.left?.count ?? 0) + (node.right?.count ?? 0);
};
//# sourceMappingURL=node.js.map