@@ -0,0 +1,567 @@
+package search;%0A%0Apublic class Search %7B%0A%09%0A%09public static boolean binarySearch(int%5B%5D a, int target) %7B%0A%09%09int low = 0;%0A%09%09int high = a.length;%0A%09%09while(low %3C= high) %7B%0A%09%09%09int mid = (low + high) / 2;%0A%09%09%09if (target == a%5Bmid%5D)%0A%09%09%09%09return true;%0A%09%09%09else if (target %3C a%5Bmid%5D)%0A%09%09%09%09high = mid -1;%0A%09%09%09else%0A%09%09%09%09low = mid + 1;%0A%09%09%7D%0A%09%09return false;%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09//input is already sorted.%0A%09%09int%5B%5D a = new int%5B%5D %7B1, 4, 7, 9, 35, 67, 233, 999%7D;%0A%09%09boolean b = binarySearch(a, 35);%0A%09%09System.out.println(b);%0A%09%09System.out.println(binarySearch(a, 44));%0A%09%7D%0A%0A%7D%0A

Create BinarySearch.java