Based on the answer from trutty refered to by Justin.Dooley, here’s how you can get the 10 top elements from an array in O(10n + 10) = O(n) steps (10 times find max item + readding) instead of O(nlog n) steps (efficient sorting and just using the last 10 elements; the float sorting example requires O(n^2) steps). So with a huge list, not sorting the complete list may be faster:
Please note, that this changes the order of the elements of the original array, as I first remove the top items and then add them again.