See More

package algorithm.search; /** * The type Binary search. */ public class BinarySearch { /** * Search boolean. * * @param arr the arr * @param a the a * @return the boolean */ public static boolean search(int[] arr,int a){ int l = arr.length; int start=0;int end =l-1; while(start<=end){ int mid =(start)+(end-start)/2; if(arr[mid]==a){ return true; }else if(arr[mid]