Use tree.capacity() instead of constant