median of median implementation
问题 Here is pseudo code for implementation of median by dividing array into 5 groups select(int A[],int first, int last, int i) { n = last - first + 1; /* n is the number elements to select from */ if (i > n) {return ERROR;} /* there is no ith smallest element */ if( n < = 100 ) { /********************* For Small n *********************/ Run selection on A[first..last] taking at most n(n-1)/2 < 50n comparisons; swap A[first+i-1] with A[first] /* put ith smallest in A[first] */ } else /* n > 100 *