Advertisements
hi,
I know how to search for the smallest value index in an unsorted array so far with this:
double currentValue = dist[0]; int smallestIndex = 0; for (int j=1; j < dist.length; j++) { if (dist[j] < currentValue) { currentValue = dist[j]; smallestIndex = j; } }
However, once one of my conditions becomes true, I want to search for next smallest value that isn't the one I just used.How would I do this?