555
555
int i, j, small;
int n = a.length;
small = j;
a[small] = a[i];
a[i] = temp;
int i;
int n = a.length;
i1.printArr(a);
i1.selection(a);
i1.printArr(a);
System.out.println();
INSERTION SORT
int i, j, temp;
int n = a.length;
temp = a[i];
j = i - 1;
while(j>=0 && temp <= a[j]) /* Move the elements greater than temp to one position ahead
from their current position*/
a[j+1] = a[j];
j = j-1;
a[j+1] = temp;
int i;
int n = a.length;
i1.printArr(a);
i1.insert(a);
i1.printArr(a);
System.out.println();
}
S