Function-types: compatability, and typedefs

Doug Gwyn gwyn at smoke.BRL.MIL
Mon Sep 4 15:15:28 AEST 1989


In article <1999 at munnari.oz.au> ok at cs.mu.oz.au (Richard O'Keefe) writes:
>If you're sorting an array of numbers, a half-way decent radix sort will
>GROSSLY outperform qsort(), and if you're sorting anything else qsort()
>is too inefficient anyway.

Unless the sorting operation is a bottleneck in your application,
you're probably better off using a prepackaged tested sorting routine
like qsort(), guaranteed to be in every (hosted) C library, than
spending the time it takes to get an adequate replacement designed,
coded, and tested.  qsort() isn't too bad for sorting internal
tables in most applications; its main deficiency is having to
perform a function call for every comparison.  One tip: since the
array of records undergoes numerous element swaps during the sort,
it is often best to set up an array of pointers to the actual data
items and sort the array of pointers instead.



More information about the Comp.lang.c mailing list