On Tue, 07 Nov 2006 10:17:24 +0100 Micha Nelissen <[EMAIL PROTECTED]> wrote:
> Chris Cheney wrote: > > Stating the obvious: but the programmer might wish to sort by the > > objects or by some combination of the strings and the objects (or > > even by entries in an external array, unrelated to the StringList) > > - the indexes are therefore needed in the general case. > > Oh right, sorting by object contents. Seems strange to me, but > perhaps useful, indeed. > > > Of course, the efficient way to build a sorted list is to set > > Sorted to False and to sort the list after all the items have been > > added. > > It doesn't matter in O-time: both are O(n log n). Nevertheless, you > probably will save some function call overhead. Insertion Sort is O(n^2). Mattias _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel