Question: Using c++ 1. Write a Binary Search function which searches for floating point num- bers in an array. The function should return the index of
1. Write a Binary Search function which searches for floating point num- bers in an array. The function should return the index of the item found in the array, or the array length if the item is not found, as we did in class. The prototype of your function might look like: int index(float ItemToFind, float Array, int ArrayLength); 2. Write a function to print your array. 3. Write a program to ask for a number from the user, use your array print- ing function to print the array, then search for the requested number in your array using your Binary Search function. Test it by searching for A) an element which is in your array, and B) an element which is missing from your array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
