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