public static function createFromArrayWithMinimumHeight(?array $array): ?BinarySearchTree {
        if (null === $array) {
            return null;
        }
        $tree = new BinarySearchTree();
        if (0 === \count($array)) {
            return $tree;
        }
        $sort = new MergeSort();
        $array = $sort->sort($array);
        $root = BinarySearchTree::_createFromArrayWithMinimumHeight($array, 0, \count($array) - 1);
        $tree = new BinarySearchTree();
        $tree->setRoot($root);
        return $tree;
    }