Randomized BST
RandBinarySearchTree inserts at the root with probability 1 / (size + 1) and otherwise walks toward a leaf. The public name BinarySearchTree is this randomized tree. RawBinarySearchTree is the plain unbalanced tree.
The constructor is new RandBinarySearchTree(compare?). An optional second argument supplies the random source used by tests.
Guide for both trees: /guide/data-structures/binary-tree