/** This module is browser compatible. */ import { BSTree } from "./bs_tree"; import { RBNode } from "./rb_node"; export * from "./_comparators"; /** * 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. */ export declare class RBTree extends BSTree { protected root: RBNode | null; constructor(compare?: (a: T, b: T) => number); /** Creates a new red-black tree from an array like or iterable object. */ static from(collection: ArrayLike | Iterable | RBTree): RBTree; static from(collection: ArrayLike | Iterable | RBTree, options: { Node?: typeof RBNode; compare?: (a: T, b: T) => number; }): RBTree; static from(collection: ArrayLike | Iterable | RBTree, options: { compare?: (a: U, b: U) => number; map: (value: T, index: number) => U; thisArg?: V; }): RBTree; protected removeFixup(parent: RBNode | null, current: RBNode | null): void; /** * Adds the value to the binary search tree if it does not already exist in it. * Returns true if successful. */ insert(value: T): boolean; /** * Removes node value from the binary search tree if found. * Returns true if found and removed. */ remove(value: T): boolean; }