noop comparator for qsort
From: Trent Buck (NOSPAMfubarbaz_at_bigpond.com)
Date: 11/14/04
- Next message: terry: "Get array size by a pointer dynamically"
- Previous message: Herbert Rosenau: "Re: getting variable type in C"
- Next in thread: Gordon Burditt: "Re: noop comparator for qsort"
- Reply: Gordon Burditt: "Re: noop comparator for qsort"
- Reply: Mark McIntyre: "Re: noop comparator for qsort"
- Reply: kevin.bagust: "Re: noop comparator for qsort"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 14 Nov 2004 08:15:15 GMT
The fourth argument is a comparator that returns `an integer less than,
equal to, or greater than zero' depending on the ordering of its
arguments.
If I don't care about the order and simply want qsort() to run as
quickly as possible, how should the comparator be defined?
If qsort were stable, the following would be best:
int
compare (void *x, void *y)
{
return 0;
}
...is this still true for a possibly non-stable qsort()?
-trent
- Next message: terry: "Get array size by a pointer dynamically"
- Previous message: Herbert Rosenau: "Re: getting variable type in C"
- Next in thread: Gordon Burditt: "Re: noop comparator for qsort"
- Reply: Gordon Burditt: "Re: noop comparator for qsort"
- Reply: Mark McIntyre: "Re: noop comparator for qsort"
- Reply: kevin.bagust: "Re: noop comparator for qsort"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|