Use a custom brew of heapsort:
1. Create a max-heap, O(n)
2. Take off the top 10, 10*O(log(n)) = O(log(n))

O(n) + O(log(n)) = O(n)
Done in O(n) time. Cannot be done faster.

Advertisements