Question: Must be done in for C++ in Visual Studio Modify the binarySearch function presented in the chapter so it searches an array of strings instead

Must be done in for C++ in Visual Studio

Must be done in for C++ in Visual Studio Modify the binarySearch

Modify the binarySearch function presented in the chapter so it searches an array of strings instead of an array on ints. Test the function with the driver program. Use the Program 8-8 as a skeleton to complete. (The array must be sorted before the finery search will work.//The binarySearchBench function performs a binary//search on array for value. It returns the number of//comparisons made.//int binarySearchBench (int array [], int size, int value)} bool found = false;//The found flag, initialized to false int first = 0//To hold the index value of the first element. int middle;//To hold the index value of the mid point int last = size -1;//To hold the index value of the last element int comparisons = 0;//To hold the number of comparisons.//Search while the value has not been found, //and the index is still in the array bounds. while (!found & & first value) last = middle -1; Determine if the value is in the upper half else first = middle + 1}//Return the number of comparisons. comparisons

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!