Trace Tabla Help
Can some one help me to do a trace table of this program,
import java.io.*;
class SelectionSort{
publicstaticvoid main(String[]args){
int[]numbers={40, 12, 37, 4, 25};
selectionSort(numbers);
displayArray(numbers);
}
publicstaticvoid selectionSort(int[]numbers){
int temp;
for(int i=0;i<numbers.length; i++){
int minIndex=i;
for(int j=i+1;j<numbers.length; j++)
{
if(numbers[minIndex]>numbers[j]){
minIndex=j;
}
}
if (minIndex!= i){
temp=numbers[i];
numbers[i]=numbers[minIndex];
numbers[minIndex]=temp;
}
}
}
publicstaticvoid displayArray(int[]numbers){
System.out.println("After Sorting");
for(int i=0;i<5;i++){
System.out.println(numbers[i]);
}
}
}

