@Override
    public void clear()
    {
        if (root == null)
        {
            return;
        }
        Stack<Node<V>> nodes = new ArrayList<Node<V>>();
        nodes.push(root);
        while (!nodes.empty())
        {
            Node<V> node = nodes.pop();
            node.value = null;
            if (node.less != null)
            {
                nodes.push(node.less);
                node.less = null;
            }
            if (node.equal != null)
            {
                nodes.push(node.equal);
                node.equal = null;
            }
            if (node.greater != null)
            {
                nodes.push(node.greater);
                node.greater = null;
            }
        }
        size = 0;
    }