Go to Latest
method BSTree.from
import { BSTree } from "https://dotland.deno.dev/std@0.146.0/collections/bs_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; }

Parameters

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