public int[] sort(int[] list) {

		int oldLength = list.length;
		int potenz = (int) Math.ceil(Math.log(oldLength) / Math.log(2));
		int length = (int) Math.pow(2, potenz);
		int[] listA = new int[length];
		int[] listB = new int[length / 2];
		int[] listC = new int[length];
		int[] listD = new int[length / 2];

		for (int i = 0; i < oldLength; i++) {
			if (i % 2 == 0) {
				listC[i / 2] = list[i];
			} else {
				listD[i / 2] = list[i];
			}
		}
		for (int i = oldLength; i < length; i++) {
			if (i % 2 == 0) {
				listC[i / 2] = Integer.MAX_VALUE;
			} else {
				listD[i / 2] = Integer.MAX_VALUE;
			}
		}
		boolean odd = true;
		for (int blockSize = 1; blockSize <= listA.length / 2; blockSize *= 2) {
			if (odd) {
				merge(listC, listD, listA, listB, blockSize);
			} else {
				merge(listA, listB, listC, listD, blockSize);
			}
			odd = !odd;
		}

		if (odd) {
			for (int i = 0; i < oldLength; i++) {
				list[i] = listC[i];
			}
		} else {
			for (int i = 0; i < oldLength; i++) {
				list[i] = listA[i];
			}
		}

		return list;

	}