public static int bin(int [] arr, int s, int e, int value){
        int m=(s+e)/2;

        if(s>e||s<e){
           return -1; //value not found
        }
        else{
            if(value>arr[m]){
                s=m+1;
                return bin(arr,s,e, value);
            }
            else if(value<arr[m]){
                e=m;
                return bin(arr, s, e, value);
            }
            else{    //value=arr[m]
                return m;
            }
        }
    }