Originally Posted By: Sat
Originally Posted By: pouncer
Isn't O(n) (what jaytea posted) better than that though?

It is indeed, as long as you can afford the space and your set of numbers consists of integers only (the O(nlogn) solution works with real numbers as well).


yup, good point! Thanks alot guys.