All pastes #897702 Raw Edit

Anonym

public text v1 · immutable
·published 2008-02-09 19:30 UTC
rendered paste body
public int[] Sort (int[] a) {
		Boolean hasSlipped;
		int []result = new int [a.length];
		
		for (int i = 0; i < a.length; i++) {
			
			if (result.length == 0) {
				result[i] = a[i];
			} else {
				hasSlipped = false;
				for(int j = 0; i < result.length; ++j) {
					if (a[i] > result[j]){
						result = slip(result, j, a[i]);
						hasSlipped = true;
					}
				}
				if (hasSlipped == false) {
					result[result.length] = a[i];
				}
			}
		}
		return result;
	}
public int[] slip (int[] ar, int pos, int value) {
    int[] result = new int[ar.length+1];
    for (i = 0; i < ar.length; i++) {
        result[i] = ar[i];
    }//for ar
    return result;
}// slip