I have got an array containing unique elements. I need to find out the first n largest elements in the array in the least complexity possible. The solution that I could thin
Find the kth biggest element, using selection algorithm. Next, iterate the array and find all elements which are larger/equal it.
complexity: O(n) for selection and O(n) for iterating, so the total is also O(n)