Question: Suppose our list of increasing integers is shown in the table below 2346791214 Suppose we conduct the binary search algorithm on this list where



Suppose our list of increasing integers is shown in the table below 2346791214 Suppose we conduct the binary search algorithm on this list where we search for 12. (a) In the language of the algorithm above, enter the correct values for the following variables for this particular search (where n is the length of the list): t = 12 L = n = 14 (b) After the first iteration of the while loop, what are the values of the following variables? A. 7 B. 2 a[3] OC6 OD+ OE. 12 OE 14 OG.9 OH. 3 a[1] = R= (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: Am= (d) After the second iteration of the while loop, some of the variables have altered valu Enter the values of the following variables after the second while loop iteration: R= m= Ask Anr def Binary Search (a, t): L = 0 R = len(a) - 1 while L S has the following elements: A. 7 OB. 2 OC.6 OD 4 OE. 12 OE 14 OG.9 H. 3 (d) After the second iteration of the while loop, some of the variables have altered values. Enter the values of the following variables after the second while loop iteration: AR= L= (e) After the third iteration of the while loop, some of the variables have altered values. Enter the values of the following variables after the third while loop iteration: L = = 4. Submit answer m= R= (f) After the 3rd iteration of the while loop, the while loop terminates and the function returns a value. Enter the return value in this case: return value Answers (in progress) m=
Step by Step Solution
3.36 Rating (159 Votes )
There are 3 Steps involved in it
a In the language of the algorithm above enter the correct values for the following variables for th... View full answer
Get step-by-step solutions from verified subject matter experts
