Binary search to find the greatest value which is less than Indexes [ Increase + 1 ]
int start = 0 ; int end = this -> Increase ; int mid = ( start + end ) / 2 ; int tVal = this -> Indexes [ this -> Increase + 1 ] ; while ( ! ( this -> Indexes [ mid ] < tVal && this -> Indexes [ mid - 1 ] > tVal ) ) { if ( this -> Indexes [ mid ] < tVal ) { end = mid - 1 ; } else { start = mid + 1 ; } mid = ( start + end ) / 2 ; }