Run both methods searching for the same number say 734 with


1. Run the binary search method on a set of unordered data. What happens?

2. Using the CArray class with the SeqSearch method and the BinSearch method, create an array of 1,000 random integers. Add a new private Integer data member named compCount that is initialized to 0. In each of the search algorithms, add a line of code right after the critical comparison is made that increments compCount by 1. Run both methods, searching for the same number, say 734, with each method. Compare the values of compCount after running both methods. What is the value of compCount for each method? Which method makes the fewest comparisons?

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Run both methods searching for the same number say 734 with
Reference No:- TGS01716036

Expected delivery within 24 Hours