import { RedBlackTree } from "https://deno.land/std@0.159.0/collections/red_black_tree.ts";
A red-black tree. This is a kind of self-balancing binary search tree. The values are in ascending order by default, using JavaScript's built in comparison operators to sort the values.
Properties
protected
root: RedBlackNode<T> | nullMethods
protected
removeFixup(parent: RedBlackNode<T> | null, current: RedBlackNode<T> | null)Adds the value to the binary search tree if it does not already exist in it. Returns true if successful.
Static Methods
from<T>(collection: ArrayLike<T> | Iterable<T> | RedBlackTree<T>): RedBlackTree<T>
Creates a new red-black tree from an array like or iterable object.
from<T>(collection: ArrayLike<T> | Iterable<T> | RedBlackTree<T>, options: { Node?: RedBlackNode; compare?: (a: T, b: T) => number; }): RedBlackTree<T>
from<T, U, V>(collection: ArrayLike<T> | Iterable<T> | RedBlackTree<T>, options: { compare?: (a: U, b: U) => number; map: (value: T, index: number) => U; thisArg?: V; }): RedBlackTree<U>