Am 09.03.2010 23:08, schrieb Martin Buchholz:
On Tue, Mar 9, 2010 at 13:08, Ulf Zibis<[email protected]> wrote:[1] current PriorityQueue snippet: ... int newCapacity = ((oldCapacity< 64)? ((oldCapacity + 1) * 2): ((oldCapacity / 2) * 3)); ... [2] new PriorityQueue snippet: ... int newCapacity += (oldCapacity< 64) ? oldCapacity : oldCapacity / 2; ...Thanks, I took your suggestion and changed it to:int newCapacity = oldCapacity + ((oldCapacity< 64) ? (oldCapacity + 2) : (oldCapacity>> 1));
Oops :-[ Can you explain the mystery about "+ 2" ? -Ulf
