Deletes a value from the binary search tree, if it exists.
The value to be deleted.
Inserts a value into the binary search tree. By default, does not allow duplicate values.
The value to be inserted.
Optional
allowDuplicates: boolean = falseFlag to allow or disallow duplicate values.
Searches for a value in the binary search tree.
The value to search for.
Class representing a Binary Search Tree (BST). A BST is a binary tree where each node has up to two children, and all nodes in the left subtree have values less than the node’s value, while nodes in the right subtree have values greater.