Template Function ADS::minMaxDivide
Defined in File Minimum.h
Function Documentation
-
template<class T, class C = std::less<>>
std::pair<T, T> ADS::minMaxDivide(const std::vector<T> &A, C less = C()) minMax() by divide et impera: the halves solved recursively and their minima and maxima compared, T( 2 ) = 1, T( n ) = 2 T( n / 2 ) + 2, i.e., 3 n / 2 - 2 comparisons for n a power of 2
- Pre:
A is not empty
- Post:
the minimum and the maximum of A (an audit)