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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f6aa,e1e578817780dac2 X-Google-Attributes: gid10f6aa,public X-Google-Thread: fc89c,97188312486d4578 X-Google-Attributes: gidfc89c,public X-Google-Thread: 109fba,baaf5f793d03d420 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,97188312486d4578 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public From: djohnson@tartarus.ucsd.edu (Darin Johnson) Subject: Re: Should I learn C or Pascal? Date: 1996/08/20 Message-ID: #1/1 X-Deja-AN: 175533895 sender: djohnson@tartarus.ucsd.edu references: <4u7hi6$s2b@nntp.seflin.lib.fl.us> <4uo74j$95p@ns.broadvision.com> organization: UCSD Computer Science and Engineering Department newsgroups: comp.lang.c,comp.lang.c++,comp.unix.programmer,comp.lang.ada,comp.os.msdos.programmer Date: 1996-08-20T00:00:00+00:00 List-Id: > Why not just pick the pivot randomly? This was suggested by Hoare in > 1962. I seem to recall a paper or method that basically said that the better you picked your pivot, the better the quicksort, and then gave some alternatives. My recollection was that you could pick a quick set of points (first, last, middle; or all random) and then choose the median of that set. And of course, you can always sort in O(n) as long as you have a finite set of things to sort :-) (actually, in O(1) theoretically but real world implications say that a finite 'n' is still an 'n') -- Darin Johnson djohnson@ucsd.edu O- "Floyd here now!"