Mail Archives: djgpp/1997/06/05/02:58:54
> >I've given up on Quick Sorting my list because I will be adding one item
> >at a time to it and the add function will call the sort function, as a
> >result Insertion Sort would probably be the best method.
> >
> Listen. If you're not going to be calling a lot of inserts or deletes in
> the middle of the list consider implementing the list as a self-adjusting
> array-- that is, when you run out of room in your array, you double its
[..]
Forgive me if I'm wrong, but I think the best implementation overall is a
dynamically-allocated binary tree. Did anyone mention that? you can even
get a complete, functional system (source code), easily adaptable to your
own needs, in the C Bible (a.k.a. Kernighan and Ritchie). That's what I
did for some UNIX accounting stuff that had previously been done with awk
(the data files were about 30MB in size) and the processing time was
reduced from 2+ days to 45 minutes. All standard ANSI C.
-----------------------------------------------------------------------
Orlando Alcantara Andico
WWW: http://www2.mozcom.com/~orly/ Email: orly AT mozcom DOT com
ICBM: 14 deg. 30' N, 120 deg. 59' E POTS: (+632) 932-2385
- Raw text -