public class BinarySearchRecursive {
 
    public static int binarySearchRecursive(int[] sortedArray, int start, int end, int key) {
         
        if (start < end) {
            int mid = start + (end - start) / 2; 
            if (key < sortedArray[mid]) {
                return binarySearchRecursive(sortedArray, start, mid, key);
                 
            } else if (key > sortedArray[mid]) {
                return binarySearchRecursiveR(sortedArray, mid+1, end , key);
                 
            } else {
                return mid;  
            }
        }
        return -(start + 1); 
    }
 
    public static void main(String[] args) {
         
        int[] array;
        
    Scanner in = new Scanner(System.in);
    System.out.println("Enter number of elements");
    n = in.nextInt(); 
    array = new int[n];
 
    System.out.println("Enter " + n + " integers");
 
 
    for (c = 0; c < n; c++)
      array[c] = in.nextInt();
 
    System.out.println("Enter value to find");
search = in.nextInt();
        int index = binarySearchRecursion(array,0,array.length,search);
        System.out.println("Found " + search +" at "+index+" index");
    }
}

@@ -1,12 +1,590 @@
+/**%0A * %0A * Recursive implemmentation of Binary Search%0A * %0A * %3Ccode%3E%0A * BinarySearch(A%5B0..N-1%5D,ow, high , value) %7B%0A *   // invariants: value %3E A%5Bi%5D for all i %3C low%0A *                   value %3C A%5Bi%5D for all i %3E high%0A *    if (high %3C low)%0A *        return not_found // value would be inserted at index %22low%22%0A *    mid = (low + high) / 2%0A *    if (A%5Bmid%5D %3E value)%0A *        return BinarySearch(A, value, low, mid-1)%0A *    else if (A%5Bmid%5D %3C value)%0A *        return BinarySearch(A, value, mid+1, high)%0A *    else%0A *        return mid%0A *%7D%0A * %3C%5Ccode%3E%0A * %0A * @author Subham Mishra%0A * */%0A
 public class
@@ -1671,16 +1671,65 @@
 earch);%0A
+        if(index%3C0)%0A        return;%0A        else%0A
         
@@ -1786,20 +1786,23 @@
 +%22 index%22);%0A
+  %0A
     %7D%0A%7D%0A

Update BinarySearchRecursive.java