Re: fast stable sort



pete wrote:
CBFalconer wrote:
pete wrote:
subramanian100in@xxxxxxxxx, India wrote:

... snip ...
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.

Insertion sort is much slower than mergesort.

Not for small arrays.

Mergesort for arrays is typically implemented using insertion
sort to sort the small partitions.

I have never bothered with such attempts, and never noticed any
speed problems.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
.



Relevant Pages

  • Re: fast stable sort
    ... For small arrays, insertion sort is usually fastest. ... Insertion sort is much slower than mergesort. ...
    (comp.programming)
  • Re: fast stable sort
    ... For small arrays, insertion sort is usually fastest. ... Insertion sort is much slower than mergesort. ...
    (comp.programming)
  • Re: fast stable sort
    ... Which sorting methods are stable? ... For small arrays, insertion sort is usually fastest. ...
    (comp.programming)
  • Re: Help with Array(s)
    ... I would think XML would return in something with an XML schema and you could ... Array.Sort sorts one-dimentional arrays, but don't think it will 2dim arrays ... to sort list by second int value and display. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Efficient python 2-d arrays?
    ... I can create large 2-dimensional arrays quite easily. ... my target audience may not have numpy so I'd prefer not to use it. ... Since I want to keep the two elements together during a sort, ... Use a list of lists, where the outer list is the easier one to sort ...
    (comp.lang.python)