B: shellsort( vec, max [, compare] );
C: void shellsort(void *vec, int vec [, void *compare] );
SHELLSORT sorts the vector "vec" according to the comparison rule implemented by the function "compare". "compare" may be omitted in the argument list; if so, a default comparison routine (see below) will be called. The "compare" function is called by SHELLSORT with the following call.
res = compare( a, b );
"compare" must return a positive value if a > b, zero if a == b, and a negative value if a < b. The default comparison function simply compares a with b as signed, one-word integers, but a user-supplied routine might use "a" and "b" as B type strings to be compared (for example). This makes SHELLSORT a general sorting routine.
Copyright © 1996, Thinkage Ltd.