From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d75494dd10472a30 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-26 13:46:44 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dennison@telepath.com (Ted Dennison) Newsgroups: comp.lang.ada Subject: Re: Ada Components - GRACE Lists (Sorting them) Date: 26 Feb 2002 13:46:44 -0800 Organization: http://groups.google.com/ Message-ID: <4519e058.0202261346.25728a77@posting.google.com> References: <3C76EE71.40506@telepath.com> <4519e058.0202260859.4ecde69f@posting.google.com> <3C7BC3CD.3B7A46DC@san.rr.com> NNTP-Posting-Host: 65.115.221.98 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1014760004 10599 127.0.0.1 (26 Feb 2002 21:46:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 26 Feb 2002 21:46:44 GMT Xref: archiver1.google.com comp.lang.ada:20477 Date: 2002-02-26T21:46:44+00:00 List-Id: Darren New wrote in message news:<3C7BC3CD.3B7A46DC@san.rr.com>... > Ted Dennison wrote: > > The main reason I was inclined to stick with Quicksort is that it is > > on *average* the fastest sort available. If "average case" is truly > > the average (a big "if", I'll grant you), > > The only problem with quicksort's worst-case behavior is that it occurs > when the list is already mostly sorted. The distribution of worst-case > cases isn't random, and it's easy to code in a way that hits the worst > case on a regular basis. Right. But if you are aware of this issue, its also fairly easy to code in a way that it *doesn't* hit the worst case. Also (and this is the part I don't think a lot of folks realise), the constants on quicksort vs. other sorts are such that "n" often has to be damn large before Quicksort's n**2 is worse than other algorithms' nlogn. I'd argue that anyone sorting that large an amount of stuff should be using the Maps package anyway. -- T.E.D. Home - mailto:dennison@telepath.com (Yahoo: Ted_Dennison) Homepage - http://www.telepath.com/dennison/Ted/TED.html