private int selectPartition(T[] d,int from,int to,int pivotIndex){
  T pivotValue=d[pivotIndex];
  swap(d,pivotIndex,to);
  int storeIndex=from;
  for (int i=from; i <= to; i++) {
    if (comp.compare(d[i],pivotValue) < 0) {
      swap(d,storeIndex,i);
      storeIndex++;
    }
  }
  swap(d,to,storeIndex);
  return storeIndex;
}

private int selectPartition ( T [ ] d , int from , int to , int pivotIndex ) { T pivotValue = d [ pivotIndex ] ; swap ( d , pivotIndex , to ) ; int storeIndex = from ; for ( int i = from ; i <= to ; i ++ ) { if ( comp . compare ( d [ i ] , pivotValue ) < 0 ) { swap ( d , storeIndex , i ) ; storeIndex ++ ; } } swap ( d , to , storeIndex ) ; return storeIndex ; }
partition the elements to select an element .
