3. Searching an Array
Create an array of 1000 ints. Search for a value known to be in the array by generating an index at random and testing to see if the searched for int is in the array at that index. Write your program to make at most 5000 guesses. Try 100 different searches and compute the average number of comparisons the program has to do. You can easily pick a target by randomly selecting a value from the array.
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions

Consult our trusted tutors.