Re: sorting

From: Kevin (anonymous_at_discussions.microsoft.com)
Date: 09/09/04


Date: Thu, 9 Sep 2004 05:32:11 -0700

The algorithm you choose depends a lot on the number of
records you need to sort. It you have a few hundered to
several thousand reocrds, something simple like a bubble
sort will be quick enough. I doubt you would even notice
the difference with that number of records using the
Quicksort or another method. If you have a huge number of
records the Quicksort method is a good choice and the
Heapsort method is also good. Both of these are fairly
complicated to code but are do-able and perform well with
a large number of records.

It would be impossible for me to explain to you in this
forum the Quicksort or Heapsort methods, so I would
suggest doing a Web search. I am certain you will find
something that explains both of these methods.

Before choosing a method, I would consider the number of
records your sorting. You might even try a bubble sort
first because it is simple to code, then if that does not
perform like you want it, try one of these other methods.

Hope that helps!

Kevin
>-----Original Message-----
>Hi,
>
>Do a search for Quicksort Algorithm which is fast, but
has its limitations
>that you cannot pass an already sorted list to it again.
For an already
>sorted list, use Bubble sort algorithm which is
relatively slower but will
>inform you that list is already sorted.
>
>I hope this helps!
>
>Rgds,
>
>Eijaz
>============================
>"Mathias" <anonymous@discussions.microsoft.com> wrote in
message
>news:028001c495df$9f692410$a401280a@phx.gbl...
>> Hi all,
>> does anyone know where I can find a fast sorting
algorithm?
>> Thanks
>> Mathias
>
>
>.
>



Relevant Pages

  • Re: Fastcode poll - Should Sort include worst case situations
    ... median algorithm, not O), there exists sequences that will beat ... quicksort and make it O. ... by many compiler vendors is "Engineering a Sort ... If it detects that a portion of an array is responding badly, ...
    (borland.public.delphi.language.basm)
  • Re: Help me with references
    ... I can't think of any situation in which bubble sort is ... > best choice for a sorting algorithm in a real machine. ... Quicksort is optimized for large Ns. ... I picked Bubblesort because your original post implied something along ...
    (comp.lang.java.help)
  • Re: Help me with references
    ... > about the problemspace that the general quicksort algorithm doesn't. ... but again you shouldn't choose bubble sort for these few cases. ... >> best choice for a sorting algorithm in a real machine. ...
    (comp.lang.java.help)
  • Re: Fastcode poll - Should Sort include worst case situations
    ... Quite was regarded Hoare's original Quicksort. ... Reversely sorted data ... Anyway QuickSort is very simple algorithm and it's complexity is precisely analized. ... further detailed retrospective of many QuickSort implementations as well as other sort algorithm will take too much time and space - wikipedia is starting point and give some interesting links for further analyze who is interested. ...
    (borland.public.delphi.language.basm)
  • Re: sorting algorithms
    ... >> Quicksort seems to have close this chapter and now nothing ... >> sorting algorithm was a competition like finding the longuest ... No sort does both on all input set ... You haven't defined what you mean by "efficient use of memory". ...
    (comp.programming)

Loading