> Date: Tue, 01 Aug 2000 12:28:19 -0400
> From: Aleksandar Donev <[log in to unmask]>
> Hi all,
>
> I am looking for efficient, and possibly well written (i.e. Fortran
> 90/95) and structured sorting rouitines (quicksort, mergesort,
> etc.), as well as routines for generating random numbers from
> uniform, gaussian and bimodal (binary) distributions.
>
> I have found some by searching the net, like Alan Miller's wonderful
> site http://www.ozemail.com.au/~milleraj/#Random number generation
> that has both types of routines, or some old F77 routines on
> fortran.com/fortran.
>
> But speed is my primary concern, so I am not sure if these are the
> best choice. The important thing to say is that the array that will
> be already partially sorted, so that algorithms that work faster on
> partially ordered arrays are strongly preferred!
For an unordered array, hash sort is fastest, as time is linear.
For a partially-ordered array, ranking sort may well be the quickest
provided that there are not many new elements, or that the new
elements are not far from the proper places. Shell sort may be a
proposition if the ranking sort is unsuitable.
There are several examples of Quicksort, two Shell sorts,
two hash sorts, and others, in my book:
"Algorithms and Data Structures in F and Fortran"
ISBN 0-9640135-4-1
> Any advice will be appreciated,
> Aleksandar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|