Template Function ADS::binarySearch(const std::vector<T>&, const T&, F&&)

Function Documentation

template<class T, class F>
long ADS::binarySearch(const std::vector<T> &A, const T &v, F &&trace)

binarySearch()

: the place of v in the sorted A, or -1; trace( i , j ,

m ) on each call that examines A[ m ]

Pre:

A is sorted

Post:

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