Erm, you've combined an O(N log N) sort with an O(N) iteration (not to mention always performing N assignemnts); whereas a simple iterative scan will always be just O(N) and will at worst perform N assignments on an already sorted list. Not exactly the most efficient way to find it . . .
Update: . . . then again maybe we need more answers like this to discourage homework questions. :)
In reply to Re: Re: How would I print the last element of a loop?
by Fletch
in thread How would I print the last element of a loop?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |