Question: Given the binary search algorithm, answer the following questions. For those referencing a list, use the following list: 2 , 5 , 1 2 ,

Given the binary search algorithm, answer the following questions. For those referencing a list, use the following list: 2,5,12,33,45,57,77,98,101,102
a) How many list items will be checked to find 33?
b) How many list items will be checked to find 77?
c) How many list items will be checked to determine 75 isn't in the list?
d) Given a list of 8 items, how many comparisons would be completed if the item was the smallest in the list?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!