- Oct 10, 2000
- 2,689
- 0
- 0
Say I have an array of 100 elements with random numbers, and only want to keep the 10 highest numbers. What's the best way?
I don't want to sort through the whole array then pick the 10 highest, since the array can contain a million elements. Is there a variation of the sort algorithm?
TIA.
I don't want to sort through the whole array then pick the 10 highest, since the array can contain a million elements. Is there a variation of the sort algorithm?
TIA.