Determine the average number of probes that each search


I need help in making a program that:

- generates a list of 5000 numbers stored in an array with values between 1 and 5000,
- prints out the middle original 200 numbers to show the results (not one number per line),
- sorts the numbers using bubble sort,
- sorts the original numbers again using quick sort.

How many swaps were made in the bubble sort and quick sort?

Now, look up 1000 random numbers using linear search on the original data and 1000 numbers using the binary search.

Determine the average number of probes that each search algorithm took. Do these values represent the theoretical values? Print out the averages for the two searches and their theoretical values.

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Determine the average number of probes that each search
Reference No:- TGS01245654

Now Priced at $20 (50% Discount)

Recommended (92%)

Rated (4.4/5)