Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/collections/mod.ts>RBTree.from

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
method RBTree.from
import { RBTree } from "https://deno.land/std@0.153.0/collections/mod.ts";

Creates a new red-black tree from an array like or iterable object.

Parameters

collection: ArrayLike<T> | Iterable<T> | RedBlackTree<T>

Returns

RedBlackTree<T>

Parameters

collection: ArrayLike<T> | Iterable<T> | RedBlackTree<T>
options: { Node?: RedBlackNode; compare?: (a: T, b: T) => number; }

Returns

RedBlackTree<T>

Parameters

collection: ArrayLike<T> | Iterable<T> | RedBlackTree<T>
options: { compare?: (a: U, b: U) => number; map: (value: T, index: number) => U; thisArg?: V; }

Returns

RedBlackTree<U>