public static int binarySearch(int[] arrays,int value,int begin,int end){

        if (begin>end){
            return -1;
        }

        int index=(end+begin)/2;

        if(arrays[index]==value){
            return index;
        }

        if(arrays[index]>value){
            end=index-1;
        }else{
            begin=index+1;
        }

        return binarySearch(arrays, value, begin, end);
    }