private static int partition(int[] array, int left, int right) {
		int pivot = array[left + ((right - left) / 2)];
		while (left <= right) {
			while (array[left] < pivot) {
				left++;
			}
			while (array[right] > pivot) {
				right--;
			}
			if (left <= right) {
				swap(array, left, right);
				left++;
				right--;
				//qSwaps++;
				//System.out.println(swaps);
			}
		}
		return left;
	}