Re: Re: qsort fix
| From: | Chad Cunningham | Date: | Mon, 31 May 1999 23:10:37 +0000 |
| Subject: | Re: Re: qsort fix | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-6343@lists.php.net to get a copy of this message | ||
Jim Winstead wrote:
> Sounds like a good reason to me. (I knew there was on there somewhere.)
>
> And for something like shuffle(), it's arguably a good thing if it
> is worse than O(n) because it will shuffle it that much more. :)
I agree, although I'm a little upset with sun on this one... I can't think of
many times when I would find it preferable for my program to core dump rather
than return an unsorted array...
BTW, I did some before and after benchmarks on my home machine, timing the
shuffle using the current shuffle with qsort vs a shuffle algorithm. See
http://zeus1.tzo.com/diff.php3. Qsort is a bit quicker
on smaller arrays, but
with such small times, it's pretty irrelevant.
--
Chad Cunningham
ccunning@math.ohio-state.edu