Write a C++ function called binarySearchArray that takes a sorted array, size and a target element as parameters. The function should return a boolean indicating whether the target element is present in the array using the binary search algorithm.
Advanced algorithms of STL
Search a number
Report a typo
Sample Input 1:
3Sample Output 1:
Element 3 found.Sample Input 2:
11Sample Output 2:
Element 11 not found.Write a program in C++
bool binarySearchArray(const int sortedArray[], int size, int target) { }
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.