src/vptree_sequential.c
// Returns the median using the QuickSelect algorithm
Returns the median using the QuickSelect algorithm
Returns the median using the QuickSelect algorithm
double quickselect_median(double arr[], int length){
    if (length % 2 == 1){
        return quickselect(arr, length, (length+1)/2);
    }
    else{
        return 0.5 * (quickselect(arr, length, length/2) + quickselect(arr, length, length/2 + 1));
    }
}
double quickselect_median ( double arr [ ] , int length ) { if ( length % 2 == 1 ) { return quickselect ( arr , length , ( length + 1 ) / 2 ) ; } else { return 0.5 * ( quickselect ( arr , length , length / 2 ) + quickselect ( arr , length , length / 2 + 1 ) ) ; } }
Returns the median using the QuickSelect algorithm
Returns the median using the QuickSelect algorithm