import { BinarySearchTree } from "https://deno.land/std@0.158.0/collections/binary_search_tree.ts";
An unbalanced binary search tree. The values are in ascending order by default, using JavaScript's built in comparison operators to sort the values.
Properties
Methods
Removes all values from the binary search tree.
Adds the value to the binary search tree if it does not already exist in it. Returns true if successful.
Checks if the binary search tree is empty.
Returns an iterator that uses in-order (LNR) tree traversal for retrieving values from the binary search tree.
Returns an iterator that uses post-order (LRN) tree traversal for retrieving values from the binary search tree.
Returns an iterator that uses level order tree traversal for retrieving values from the binary search tree.
Returns an iterator that uses pre-order (NLR) tree traversal for retrieving values from the binary search tree.
Removes node value from the binary search tree if found. Returns true if found and removed.
Returns an iterator that uses reverse in-order (RNL) tree traversal for retrieving values from the binary search tree.
Returns an iterator that uses in-order (LNR) tree traversal for retrieving values from the binary search tree.
Static Methods
Creates a new binary search tree from an array like or iterable object.