// Prog: binary_search_test.cpp // test your binary search function! #include #include #include typedef std::vector::const_iterator Cvit; // PRE: [begin, end) is a valid range, and the elements *p, // p in [begin, end) are in ascending order // POST: return value is an iterator p in [begin, end) such // that *p = x, or the iterator end, if no such iterator // exists Cvit bin_search (const Cvit begin, const Cvit end, const int x) { // enter your code here! return end; } int main() { // input length of test array, n >= 0 int n; std::cin >> n; std::vector v(n); // 0, 2, 4, 6,... for (int i=0; i