
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?
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
