I'm trying to find the smallest value in 3 different array but it's not turning out right I don't think. It never seems to return the middle array even if it is the smallest. It's always either 0 or 2. What seems to be my logic error?
int smallest;
for(int i = 1; i < 3; i++)
{
if(queue[i].getCount() < queue[0].getCount())
smallest = i;
else
smallest = 0;
}
queue[smallest].getCount()in the loop. (After making the correction, don't forget to initializesmallestproperly in the declaration.)