Question: Write a C Program: .Write your own function that will perform a binary search on the sorted array. The function is to return two values.
Write a C Program:

.Write your own function that will perform a binary search on the sorted array. The function is to "return" two values. The first should be the position in the array where the value was found or -1 if the value was not found. The second is the number of comparisons needed to determine if/where the value is located in the array. Suggested prototype: int binSearch (int arr], int size, int target, int numComparisons)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
