in reply to Re: largest number inside array/hash
in thread largest number inside array/hash
Think back to second year of college, when you took that Algorithms course.
A good sort such as quick sort is O( N logN ), poor ones such as bubble sort are O( N^2 ). A max() function requires a single pass through the list, and so is O( N ). It would be silly to do N log N - N ( i.e. N (log N - 1) ) operations more than you need to.
--
TTTATCGGTCGTTATATAGATGTTTGCA
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: largest number inside array/hash
by tilly (Archbishop) on Apr 08, 2004 at 05:31 UTC |
In Section
Seekers of Perl Wisdom