in reply to Fast/Efficient Sort for Large Files

Hi,

Have a look at the schwartzian transform. Google or super search on it, and you'll get lots of hits

What is does is, it takes a subset of your strings and sorts these, and than uses the whole array, and rearrages it based on the sorted subset.
---------------------------
Dr. Mark Ceulemans
Senior Consultant
IT Masters, Belgium

  • Comment on Re: Fast/Efficient Sort for Large Files

Replies are listed 'Best First'.
Re: Re: Fast/Efficient Sort for Large Files
by tommyw (Hermit) on Dec 19, 2002 at 12:27 UTC

    No it doesn't. It pre-computes the sort keys, sorts the entire array based on the keys, and discards them again, rather than using a naive sort function which recomputes the keys every time it needs them.

    And it's not going to help in this case, as the sort key is simply the initial substring of the data.

    --
    Tommy
    Too stupid to live.
    Too stubborn to die.

Re^2: Fast/Efficient Sort for Large Files
by Aristotle (Chancellor) on Dec 19, 2002 at 13:42 UTC
    In addition to tommyw's comments, a Schwartzian Transform also consumes extra memory, so even if it made sense here, it wouldn't exactly be efficient.

    Makeshifts last the longest.