public <T> T[] toArray(T[] a, int offset) { if (size() + offset < a.length) a = Arrays.copyOf(a, size() + offset); BTree.toArray(tree, lowerBound, upperBound + 1, a, offset); return a; }
public <T> T[] toArray(T[] a, int offset) { int size = size(); if (a.length < size + offset) a = Arrays.copyOf(a, size); BTree.toArray(tree, a, offset); return a; }