@@ -0,0 +1,849 @@
+package Basics;%0A%0A/**%0A * Created by matao on 5/26/16.%0A */%0Apublic class BinarySearch %7B%0A    public static void main(String%5B%5D args) %7B%0A        int a%5B%5D = %7B1, 2, 5, 6, 9, 15, 32, 87, 104%7D;%0A        System.out.println(rank(17, a));%0A        System.out.println(rank(2, a));%0A        System.out.println(rank(32, a));%0A    %7D%0A%0A    public static int rank(int target, int%5B%5D array) %7B%0A        return rank(target, array, 0, array.length - 1);%0A    %7D%0A%0A    public static int rank(int target, int%5B%5D array, int low, int high) %7B%0A        if (low %3E high) %7B%0A            return -1;%0A        %7D%0A%0A        int mid = low + (high - low) / 2;%0A        if (target %3C array%5Bmid%5D) %7B%0A            return rank(target, array, low, mid - 1);%0A        %7D else if (target %3E array%5Bmid%5D) %7B%0A            return rank(target, array, mid + 1, high);%0A        %7D else %7B%0A            return mid;%0A        %7D%0A    %7D%0A%7D%0A

Add BinarySearch