Question: It is a C++ assignment, please describe you codes and include well documentation. Please dont copy and paste others answer cuz i already tried and
It is a C++ assignment, please describe you codes and include well documentation. Please dont copy and paste others answer cuz i already tried and there are false.
Requested files: BinarySearch.h, BinarySearch.cpp, BinarySearch_test.cpp
Type of work: Individual work
Write a program that will use a recursive binary search to locate an integer in a sorted array. The integer values will be provided in a file named dataarray.bin. You should dynamically allocate memory sufficient to hold all elements in this array and read the contents of this file into your data structure.
Your code must implement a function called recursiveBinarySearch(int start_index, int end_index, int_targetValue) which will perform the binary search for the integer value entered at the command line.
If the value is found you should print a string "N:V" where N is the number of comparisons made before the value V is found. If the value V is not found in the array print a dash, for example "23:-"
You should test you class with a driver program named BinarySearch_test.cpp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
