Re: fast stable sort
- From: cri@xxxxxxxx (Richard Harter)
- Date: Thu, 13 Nov 2008 17:10:59 GMT
On Thu, 13 Nov 2008 05:19:53 -0500, pete <pfiland@xxxxxxxxxxxxxx>
wrote:
subramanian100in@xxxxxxxxx, India wrote:
I am practicing C programming at home. The C standard library function
qsort() as per the C standard document, need not be stable. So I want
to know the following.
Which sorting methods are stable ?
Among the stable sorting methods, which method is both stable and
fastest ?
For small arrays, insertion sort is usually fastest.
For large arrays, merge sort is usually fastest,
but it is not an in place sorting algorithm.
Caveat: There are in place stable versions of mergesort. IIRC
the best known is about three times slower than a version that
uses extra memory.
"Merge sort is not in place" is one of those bits of comp sci
folklore.
Richard Harter, cri@xxxxxxxx
http://home.tiac.net/~cri, http://www.varinoma.com
Save the Earth now!!
It's the only planet with chocolate.
.
- Follow-Ups:
- Re: fast stable sort
- From: Tim Rentsch
- Re: fast stable sort
- From: pete
- Re: fast stable sort
- References:
- fast stable sort
- From: subramanian100in@xxxxxxxxx, India
- Re: fast stable sort
- From: pete
- fast stable sort
- Prev by Date: Re: fast stable sort
- Next by Date: Re: Red-black trees?
- Previous by thread: Re: fast stable sort
- Next by thread: Re: fast stable sort
- Index(es):
Relevant Pages
|