0
Q:

std::binary_search

// C++ code to demonstrate the working of binary_search() 

    vector<int> arr = {10, 15, 20, 25, 30, 35}; 
    // using binary_search to check if 15 exists 
    if (binary_search(arr.begin(), arr.end(), 15)) 
       cout << "15 exists in vector"; 
    else 
       cout << "15 does not exist"; 
 
0

New to Communities?

Join the community