Redo Programming Challenge 6 but use a binary search. Bonus: Add pseudocode to check how many iterations
Question:
Redo Programming Challenge 6 but use a binary search.
Bonus: Add pseudocode to check how many iterations must be made for each number entered by the user, and, if you also complete Programming Challenge 6 in RAPTOR, you can compare the two values.
Bonus: Change the number of elements in the Squares array to 500. Run both kinds of searches (Programming Challenges 6 and 7) several times and keep track of how many iterations each program must make for each search. Does your data demonstrate that one algorithm is more efficient than the other? Justify your response.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: