Quickest and most efficient method to search top 3 numbers?
- by Donal Rafferty
I currently have an array of around 8 - 10 numbers that changes on a periodic basis.
So around every 5 - 10 seconds the numbers get updated.
I need to get the top 3 numbers in the array every 10 seconds.
This is all done on a mobile device.
At the minute I iterate through the array 3 times and each time I take out the three highest numbers and place them in three previously declared variables.
My question is what should I look to do to increase speed and efficiency in this instance?