//The following is the method for binary search //It has two parameters : an array A if integers, and number x to be searched //It assumes that the array is sorted. //Please go through it carefully. Try to ponder over all the statements, //especially the condition of the while loop. Can you think of other //formulations for the condition ? Also, try to see what will happen //if we replace "left=mid+1" by "left=mid" and "right=mid-1;" by" right=mid;" public static boolean Bin_search(int[] A, int x) { int left =0; int right=A.length-1; boolean Is_found = false; int mid; while(Is_found==false && left<=right) { mid = (left+right)/2; if(A[mid]==x) Is_found=true; else if(A[mid]>x) right = mid-1; else left = mid+1; } return Is_found; }