Question: 4 points) This exercise reters to the binary search algonithm given below. binary search (x: integer, a,a2 an increasing integers) 1 iis left endpoint of

 4 points) This exercise reters to the binary search algonithm given
below. binary search (x: integer, a,a2 an increasing integers) 1 iis left

4 points) This exercise reters to the binary search algonithm given below. binary search (x: integer, a,a2 an increasing integers) 1 iis left endpoint of search interval ) j:# n {j is right endpoint of search interval } whilei a," then i :-m+1 else j := m end if x = ai then location : else location0 location is the subscript of term equal to x, or 0 if x is not found) Suppose our list of increasing integers is shown in the table below 45611 12 131 Suppose we conduct the binary search algorithm on this list where we search for 13. (a) In the language of the algorithm above, enter the correct values for the following variables for this particular search: (b) After the first iteration of the while loop, what are the values of the following variables? (c) Intuitively, after the first iteration of the while loop, we have cut down our search to a set S of roughly half of the original numbers on the list. Check the numbers that are in the set S after the first iteration of the while loop: S has the following elements: OA. 12 . 15 Oc. 11 OD. 5 OE. 13 OG.2 H. 4

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 Databases Questions!