@std/data-structures@0.215.0
latest
Works with
•JSR Score58%•It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun




Published2 years ago (0.215.0)
Classes
c
RedBlackTree<T>(compare?: () => number)
a: T,
b: T
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.
- from<T>(collection: ArrayLike<T> | Iterable<T> | RedBlackTree<T>): RedBlackTree<T>
Creates a new red-black tree from an array like or iterable object.
- insert(value: T): boolean
Adds the value to the binary search tree if it does not already exist in it. Returns true if successful.
- remove(value: T): boolean
Removes node value from the binary search tree if found. Returns true if found and removed.
- removeFixup(): voidparent: RedBlackNode<T> | null,current: RedBlackNode<T> | nullNo documentation available
- root: RedBlackNode<T> | nullNo documentation available