public class selectionsort { final static int[] data = {23,11,13,44,14,24,22,12,21,32,41,43,31,33,34,42}; public void selectionSort2(int[] x) { for (int i=0; i x[j]) { minIndex = j; // Remember index of new minimum } } if (minIndex != i) { //... Exchange current element with smallest remaining. int temp = x[i]; x[i] = x[minIndex]; x[minIndex] = temp; System.out.println("step: "+i+" "+minIndex+" number:"+temp+" "+x[i]); printdata(); } } } public void selectionSort(int[] x) { for (int i=0; i x[j]) { //... Exchange elements int temp = x[i]; x[i] = x[j]; x[j] = temp; System.out.println("step: "+i+" "+j+" number:"+temp+" "+x[i]); printdata(); } } } } public void printdata() { String s = new String("{"); for(int i=0; i