Question: c++ help with Question 9, Thank you! test code and header for your programs: // test_searches.cpp #include searches.h #include using namespace std; int main(){ int

c++ help with Question 9, Thank you!

c++ help with Question 9, Thank you! test code and header for

test code and header for your programs:

// test_searches.cpp #include "searches.h" #include  using namespace std; int main(){ int a[7]={1,5,8,12,17,23,39}; int k,n; cout  

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

// test_searches.cpp #include "searches.h" #include  using namespace std; int main(){ int a[7]={1,5,8,12,17,23,39}; int k,n; cout   8. Write a C++ function named linear search that accepts an integer value to ing search for, an array of integers, and the number of integers in the array. Us the linear search algorithm, the function must return the position of the first parameter in the array. If the first parameter is not in the array, the function returns -1 9. Write a C+-+ binary search function with the same parameters as the linear search function described in the previous exercise. Search the list using the binary search algorithm and return the location of the first parameter in the array (returning -1 if the value is not found). The array that is passed to the binary search algorithm must be sorted

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!