Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
method BinarySearchTree.from
import { BinarySearchTree } from "https://deno.land/std@0.218.0/data_structures/binary_search_tree.ts";

Creates a new binary search tree from an array like or iterable object.

Parameters

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

Parameters

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

Parameters

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