Sorting help!

Jon Hylands jon at huv.com
Thu Nov 15 18:13:06 UTC 2001


On Thu, 15 Nov 2001 16:04:59 +0100, Stefan Schmiedl <s at xss.de> wrote:

> > <title>,<name>,<reference>,<number>
> > 
> > Sort would have to do in ascending order of
> > <title>,<name>,<reference>,<number>
> 
> as you do not need to switch columns, you
> could just read the file line-by-line into
> a large array of strings and then use the
> standard sort method for arrays.
> 
> Nah, it can't be that simple. What am I overlooking here?

Because the strings are not all the same length. They are comma-delimited.

One point to make for sorting: On large sets, it is almost always
significantly faster to read all the objects you are going to sort into a
normal collection and the sort the whole thing, rather than doing an
insertion sort item by item.

Later,
Jon

--------------------------------------------------------------
   Jon Hylands      Jon at huv.com      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com




More information about the Squeak-dev mailing list