Re: attempt at qsort implementation

From: pete (pfiland_at_mindspring.com)
Date: 09/29/04


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