Template Function ADS::uniformBinarySearch

Function Documentation

template<class T>
long ADS::uniformBinarySearch(const std::vector<T> &A, const T &v, long *cmp = nullptr)

the uniform binary search of v in the sorted A: its place, or -1; the comparisons go to *cmp, if given

Pre:

A is sorted (an audit)

Post:

the result is -1 if and only if v is not in A