Question: Use the following code for the next questions: public boolean bins (int[] A, int st, int low, int high) f if( low high )
Use the following code for the next questions: public boolean bins (int[] A, int st, int low, int high) f if( low high ) ( return false; } int mid = (int) ((low + high)/2); if( A[mid] st ) return true; else if( A[mid] >st) return bins (A, st, low, mid-1); else return bins (A, st, mid+1, high); A) Trace until completion and show values of all variables for the following input: A 1, 3, 6, 8, 9, 12, 18, 22, 23, 25, 28, 32, 45, 57, 78, 87} st-63 low low-0 high A.length-1 high Mid A[mid] st Why did we stop (5 words or less please)? B) Trace until completion and show values of all variables for the following input: A 11.3, 6, 8, 9, 12, 18, 22, 23, 25, 28, 32, 45, 57, 78, 87) st-28 low low-0 high-A.length-1 high mid A[mid] st Why did we stop (5 words or less please)? Describe the runtime of the above code (5 words or less please):
Step by Step Solution
3.39 Rating (155 Votes )
There are 3 Steps involved in it
A The table is given below low high Mid AMid st 0 15 7 22 63 8 ... View full answer
Get step-by-step solutions from verified subject matter experts
