Re: SortedList: best practices with java 1.5



On Fri, 4 Nov 2005 10:20:25 -0600, "Joan" <Joan@xxxxxxxxxxxxxx> wrote,
quoted or indirectly quoted someone who said :

>> I saw the technique using Collections.binarySearch() method to
>> identify
>> the insertion point. In terms of speed, is that faster than
>> simply
>> calling Collections.sort() on every add()? I did a fair amount
>> of
>> googling and searching of this group without finding any RECENT
>> discussions (since 1.5) regarding this subject.

You can be lazy and just tack them on the end, and only sort when you
need the sorted order.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.



Relevant Pages