public T[] getBFS() {
        Queue<Node<T>> queue = new ArrayDeque<Node<T>>();
        T[] values = (T[]) new Comparable[size];
        int count = 0;
        Node<T> node = root;
        while (node != null) {
            values[count++] = node.id;
            if (node.lesser != null)
                queue.add(node.lesser);
            if (node.greater != null)
                queue.add(node.greater);
            if (!queue.isEmpty())
                node = queue.remove();
            else
                node = null;
        }
        return values;
    }