Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following: 2 10 17 45 49 55 68 85 92 98 110 Using the binary search

ID: 3609326 • Letter: C

Question

Consider the following:
2 10 17 45 49 55 68 85 92 98 110
Using the binary search, how many comparisons are required todetermine wheather the following items are in the list? Show thevalues of FIRST, LAST, MIDDLE, and the number of comparisons afterthe iteration of the loop. a. 15 b. 49 c. 98 d. 99
2 10 17 45 49 55 68 85 92 98 110
Using the binary search, how many comparisons are required todetermine wheather the following items are in the list? Show thevalues of FIRST, LAST, MIDDLE, and the number of comparisons afterthe iteration of the loop. a. 15 b. 49 c. 98 d. 99

Explanation / Answer

please rate - thanks the 2 compares are counted as 1 because if doing by hand it wouldbe 1 comparison import java.util.*;    public class binarysearch       { public static void main( String [] args )         { Scanner in= newScanner(System.in);         int size = 11,num;         int [ ] a = new int[]{2,10,17,45,49,55,68,85,92,98,110};               for( int i = 0; i