static private double quickSelect(IDoubleVector x,int k,int start,int end){
  if (k < start || k > end) {
    throw new AdeCoreIllegalArgumentException("requested selection is outside of range");
  }
  final int pivotIndex=((int)Math.random() * (end - start + 1)) + start;
  final int pivotPosition=partition(x,start,end,pivotIndex);
  if (pivotPosition == k) {
    return x.get(k);
  }
 else   if (pivotPosition < k) {
    return quickSelect(x,k,pivotPosition + 1,end);
  }
 else {
    return quickSelect(x,k,start,pivotPosition - 1);
  }
}

static private double quickSelect ( IDoubleVector x , int k , int start , int end ) { if ( k < start || k > end ) { throw new AdeCoreIllegalArgumentException ( "requested selection is outside of range" ) ; } final int pivotIndex = ( ( int ) Math . random ( ) * ( end - start + 1 ) ) + start ; final int pivotPosition = partition ( x , start , end , pivotIndex ) ; if ( pivotPosition == k ) { return x . get ( k ) ; } else if ( pivotPosition < k ) { return quickSelect ( x , k , pivotPosition + 1 , end ) ; } else { return quickSelect ( x , k , start , pivotPosition - 1 ) ; } }
quicksort like algorithm to select k ' th member . has expected linear performance but o ( n ^ 2 ) worst case . considered to have good performance in practice
