public class smalletsSort { public int[] sortSmallAscending(int arr[],int pos) { int temp=arr[pos]; for(int i=pos;iarr[i]) { temp=arr[i]; arr[i]=arr[pos]; arr[pos]=temp; } } pos++; if(pos!=arr.length-1) sortSmallAscending(arr,pos); else return arr; return arr; } public int[] sortSmallDescending(int arr[],int pos) { int temp=arr[pos]; for(int i=pos;iarr[i]) { temp=arr[i]; arr[i]=arr[pos]; arr[pos]=temp; } } pos++; if(pos!=arr.length-1) sortSmallDescending(arr,pos); else return arr; return arr; } }