Template Function ADS::lowerBound(const std::vector<T>&, const T&, std::size_t, std::size_t, C)
Defined in File BinarySearch.h
Function Documentation
-
template<class T, class C = std::less<>>
std::size_t ADS::lowerBound(const std::vector<T> &A, const T &v, std::size_t lo, std::size_t hi, C less = C()) the first place in [ lo , hi ) of an item not smaller than v, hi if none
- Pre:
lo <= hi <= n and A[ lo .. hi ) is sorted
- Post:
A[ r - 1 ] < v <= A[ r ], within [ lo , hi ]