Re: attempt at qsort implementation
From: pete (pfiland_at_mindspring.com)
Date: 09/29/04
- Next message: pete: "Re: contiguity of arrays"
- Previous message: pete: "Re: invalid floating point value"
- In reply to: Gordon Burditt: "Re: attempt at qsort implementation"
- Next in thread: Michael Mair: "Re: attempt at qsort implementation"
- Reply: Michael Mair: "Re: attempt at qsort implementation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 29 Sep 2004 10:40:36 GMT
Gordon Burditt wrote:
>
> >I had some spare time and decided to try to
> > implement the standard library qsort.
> qsort() is not required to implement any particular sort algorithm.
> It's just supposed to sort.
> One thing worth checking here is how well your algorithm will operate
> with a bogus compare routine (e.g. one which always returns -1, or
> one for which cmp(a,b) is not guaranteed to equal -cmp(b,a) ).
> Some implementations end up going outside the passed-in
> array in such circumstances.
The behavior of qsort with a bogus compare routine, is undefined,
so what's the point?
-- pete
- Next message: pete: "Re: contiguity of arrays"
- Previous message: pete: "Re: invalid floating point value"
- In reply to: Gordon Burditt: "Re: attempt at qsort implementation"
- Next in thread: Michael Mair: "Re: attempt at qsort implementation"
- Reply: Michael Mair: "Re: attempt at qsort implementation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]