in reply to Re: finding min and max of array recursivly
in thread finding min and max of array recursivly

Yes, for larger datasets.

My first gut-level feel for "speed of algorithms" comes from my "how much entropy did you undo with that calculation?". In this case, besides knowing the minimum and maximum, you also knew (at one point, before you threw it away) the second-smallest, third-smallest, on up to the second-largest. It must have taken time to calculate those, so you've wasted time to calculate things that don't affect the outcome.

Note that this is just for "back of the thumbnail" calculations. I've been wrong using this method, but I'm not a theoretical mathematician... I'm a hacker. {grin}

-- Randal L. Schwartz, Perl hacker

  • Comment on RE: Re: finding min and max of array recursivly