Search Benchmarks
Modify the sequentialSearch and binarySearch methods presented in this chapter so they keep a count of and display on the screen the number of comparisons they make before finding the value they are searching for. Then write a program that has an array of at least 20 integers. It should call the sequentialSearch method to locate at least five of the values. Then it should call the binarySearch method to locate the same values. On average, which method makes the fewest comparisons?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.