Quick Sort in C

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Jul 19 16:01:34 AEST 1989


In article <2762 at zeus.unl.edu> STEIMLE at zeus.unl.edu (Scott A.) writes:
>I'm not at all acquainted with C, but need a short section of code to
>perform a quick sort.  Does anyone out there have this?

It should already exist in your C library, under the name qsort().
All you have to do is set up the array to be sorted (which might
consist of pointers to other objects), provide a function that
knows how to compare the order of two records in the array, and
invoke the library function to perform the quicksort algorithm.



More information about the Comp.lang.c mailing list