Re: comparison of sorting algorithms
From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 06/14/04
- Next message: John Raghanti: "Re: New Programmer Seeks Experiential Wisdom"
- Previous message: beliavsky_at_aol.com: "Re: which language?"
- In reply to: Peter Ammon: "Re: comparison of sorting algorithms"
- Next in thread: Thomas Stegen: "Re: comparison of sorting algorithms"
- Reply: Thomas Stegen: "Re: comparison of sorting algorithms"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 14 Jun 2004 12:50:24 GMT
Peter Ammon wrote:
>
> CBFalconer wrote:
>
> > Dan Tex1 wrote:
> >
> > ... snip ...
> >
> >>I tested a hybrid, non-recursive quicksort that uses insertion
> >>sort as partitions of data to be sorted become smaller. I tried
> >>it with different types of data in all sorts of different
> >>starting orders. I tried small data sets and large ones ( many
> >>megabytes of data, files 30, 40 MB and larger ). I found that
> >>it worked great for pretty much eveything.
> >
> >
> > There is always an input that will make it run in O(N*N). See:
> >
> > SOFTWARE—PRACTICE AND EXPERIENCE, VOL. 29(0), 1–4 (0 1999)
> > A Killer Adversary for Quicksort
> > M. D. MCILROY
> >
>
> But see introsort, a variant of Quicksort that does not.
>
> http://www.nist.gov/dads/HTML/introspectiveSort.html
> http://citeseer.ist.psu.edu/582691.html
The following from the first link above:
Definition: A variant of quicksort which switches to
heapsort for pathological inputs, that is, when execution
time is becoming quadratic.
Also known as introsort.
Found at <http://www.cs.rpi.edu/~musser/gp/introsort.ps>
I have not read the paper yet, but it seems to me that one might
as well code for heapsort in the first place. I would expect the
result to be no more than 25% slower than a quicksort, and to
always have NlnN performance.
-- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
- Next message: John Raghanti: "Re: New Programmer Seeks Experiential Wisdom"
- Previous message: beliavsky_at_aol.com: "Re: which language?"
- In reply to: Peter Ammon: "Re: comparison of sorting algorithms"
- Next in thread: Thomas Stegen: "Re: comparison of sorting algorithms"
- Reply: Thomas Stegen: "Re: comparison of sorting algorithms"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|