private int partition(Comparable[] tempArray, int lower, int upper){
		int i = lower, j = upper+1;
		Comparable v = tempArray[lower];
		while(true)
		{
			while (less(tempArray[++i],v)) if(i == upper) break;
			while (less(v,tempArray[--j])) if (j == lower) break;
			if (i >= j) break;
			exch(tempArray,i,j);
		}
		exch(tempArray, lower, j);
		return j;
	}