Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Molly Brown   on Nov 16 In Java Category.

  
Question Answered By: Aalia Arain   on Nov 16

Yes this confirms what I was looking for
which was a nested for loop. Here is my code:

int[] numbers = new int[sortTotal];

for ( index = 0; index < numbers.length; index++) {

numbers[index] = terminal.readInt(">");
}

for (index = 0; index < numbers.length; index++){

min = index;
for ( j = index+1; j < numbers.length; j++){
if ( numbers[j] < numbers[min] )
min = j;
}

temp = numbers[index];
numbers[index] = numbers[min];
numbers[min] = temp;

}

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on simple array Or get search suggestion and latest updates.


Tagged: