private static void quicksortusingmedianpivot(int l, int k) {
		// TODO Auto-generated method stub
		if(l==k){
			return;
		}
		if (k>l){
		int i=l+1; // startelement
		int j=l+1; // 
		int temp;
		int arrayr[] = new int[3];
		arrayr[0] = array[l];
		arrayr[1] = array[k];
		arrayr[2] = array[(l+k)/2];
		Arrays.sort(arrayr);
		int pivot = 0;

		if(arrayr[1] == array[l]){
	
			pivot = array[l];	
		}
		if(arrayr[1] == array[k]){
			
			
			temp = array[k];
			array[k] = array[l];
			array[l]=temp;
			pivot = array[l];
			}
		if(arrayr[1] == array[(l+k)/2]){
			
			temp = array[(l+k)/2];
			array[(l+k)/2] = array[l];
			array[l]=temp;
			pivot = array[l];	
			}
			
			for(j=l+1;j<k+1;j++){
				int vella = array[j];
				counter++;
				if(array[j]<pivot){
					
					temp = array[i];
					array[i] = array[j];
					array[j]=temp;
					
					i++;
					
					
					
					
				}
				
					
					
				
			}
			i--;
		
			temp = array[i];
			array[i] = array[l];
			array[l] = temp;
			
			quicksortusingmedianpivot(l,i-1);
			quicksortusingmedianpivot(i+1,k);
		return;
			
		}else{
			return;
		}
	}