How to write a sorting program that will sort everything?

Blair P. Houghton bhoughto at nevin.intel.com
Sun Mar 24 12:14:57 AEST 1991


In article <1991Mar23.164807.7318 at helios.physics.utoronto.ca> neufeld at aurora.physics.utoronto.ca (Christopher Neufeld) writes:
>In article <3403 at inews.intel.com> bhoughto at pima.intel.com (Blair P. Houghton) writes:
>>It can't be done.  You can always define a type of input
>>for which "sorting" isn't defined.
>>
>   Huh? I may be relatively new to C but isn't the stdlib function
>qsort() an example of a program which does just that? You pass it the

Y'know, it would've helped a little if you'd just bothered to read
down to the end of my posting.  It was qsort-a-rama...

It still doesn't solve the problem of "sorting any data
type", since that problem is impossible to solve (I.e., you
have to know in advance the types that may be passed, which
necessarily omits those types you do not know and which
are, by the definition of the word "any", part of the set
"any data type").

				--Blair
				  "Here, have a NULL-prize..."



More information about the Comp.lang.c mailing list