go ahead... be a heretic | |
PerlMonks |
Re: max of N numbers?by TedPride (Priest) |
on May 27, 2006 at 20:04 UTC ( [id://552029]=note: print w/replies, xml ) | Need Help?? |
There is no way to find the max of N numbers without using comparison operators. However, you can just add a short function to your code for finding max:
This takes linear time. Or you can use a sort, which takes O(n lg n) time:
In Section
Seekers of Perl Wisdom
|
|