Question: I need help with number 8 please Modify the binary search function presented in this chapter so it searches an array of strings instead of
I need help with number 8 please Modify the binary search function presented in this chapter so it searches an array of strings instead of an array of ints. Test the function with a driver program. Use Program 9.9 as a skeleton to complete. (The array must be sorted before the binary search will work.) Write a program that has at least 20 integers stored in an array in ascending order. It should call a function that uses the linear search algorithm to locate one of the values. The function should keep a count of the number of comparisons it makes until it finds the value. The program then should call a function that uses the binary search algorithm to locate the same value. It should also keep count of the number of comparisons it makes. Display these two counts on the screen. Write a program that uses two identical arrays of at least 20 integers stored in a random order. It should call a function that uses the bubble sort algorithm to sort one of the arrays in ascending order. The function should count the number of exchanges it makes. The program should then call a function that uses the selection sort algorithm to sort the other array. It should also count the number of exchanges it makes. Display these two counts on the screen. Write a program that uses two identical arrays of eight randomly ordered integers. It should display the contents of the first array, then call a function to sort it using an ascending order bubble sort, modified to print out the array contents after each pass of the sort. Next the program should display the contents of the second array, then call a function to sort it using an ascending order selection sort, modified to print out the array contents after each pass of the sort Program 8-31 from Chapter 8 creates an array of four Circle objects, then display the area of each object. Using a copy of that program as a starting point, modify it to create an array of seven Circle objects initialized with the following radii: 2.5, 4, 0, 1.0, 3.0, 6.0 5.5, 2.0. Then use a bubble sort to arrange the objects in ascending order of radius size before displaying the area of each object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
