On Fri, Mar 5, 2010 at 02:48, Kevin L. Stern <kevin.l.st...@gmail.com> wrote: > Hi Martin, > > Thank you for your reply. If I may, PriorityQueue appears to employ the > simple strategy that I suggested above in its grow method: > > int newCapacity = ((oldCapacity < 64)? > ((oldCapacity + 1) * 2): > ((oldCapacity / 2) * 3)); > if (newCapacity < 0) // overflow > newCapacity = Integer.MAX_VALUE; > > It might be desirable to set a common strategy for capacity increase for all > collections.
The PriorityQueue implementation is better than always doubling, but not better enough to change the expansion policy of existing heavily used collection classes. Martin