private static <T extends Comparable<? super T>> int partition(ArrayList<T> list, int start, int end){
		
		
		int pivPos = bestPivotStrategy(list,start,end);
		T pivot = list.get(pivPos);
		normalSwap(list, start, pivPos);

		int left = start+1;
		int right = end;
		while(true){
			while(left <= right)
				if(list.get(left).compareTo(pivot) < 0){
					left++;
				}
				else{
					break;
				}
			while(right > left){
				if(list.get(right).compareTo(pivot) > 0)
					right--;
				else
					break;
			}
			if(left >= right)
				break;
			normalSwap(list, left, right);


		}
		list.set(start, list.get(left-1));
		list.set(left-1, pivot);
		return left-1;

	}