static void sort(int[] array, int start, int end) {

		System.out.println(">>>>>>>>>>>> " + start + " >>>>>> " + end
				+ " >>>>>>>>>>>>>>>>>>>>");
		for (int i = 0, count = array.length; i < count; i++) {
			System.out.print(array[i] + ", ");
		}
		System.out.println();

		assert start <= end;

		int oStart = start;
		int oEnd = end;

		int key = array[start];

		int keyIndex = start;

		boolean stepForward = true;

		while (start <= end) {

			if (stepForward) {
				int tmp = array[end];
				if (tmp < key) {
					array[end] = key;
					array[keyIndex] = tmp;
					keyIndex = end;
					stepForward = false;
				}
				end--;
			} else {
				int tmp = array[start];
				if (tmp > key) {
					array[start] = key;
					array[keyIndex] = tmp;
					keyIndex = start;
					stepForward = true;
				}
				start++;
			}
		}

		if (oStart < keyIndex) {

			// System.out.println("start: "+ keyIndex);
			sort(array, oStart, keyIndex - 1);
		}

		if (oEnd > keyIndex) {
			// System.out.println("end: "+ keyIndex);
			sort(array, keyIndex + 1, oEnd);
		}

	}