#RECURSIVE BINARY SEARCH
def BINARYSEARCH(arr,start,end,key): 
    mid= start + (end -start) // 2 #Calculating the mid index of array
    while( start <= end ): 
        if(arr[mid] == key): 
            return mid #Key present in the array
        elif(arr[mid] > key): #Key present at left subarray
            return BINARY_SEARCH(arr, start , mid-1 ,key)            
        elif(arr[mid] < key): #Key present at right subarray
            return BINARY_SEARCH(arr, mid+1, end ,key)
    else: 
        return -1  #Key not found
a = [-35, -10, 88, 788, 1034451]#Sorted Array
b=  len(a)  #Length of the array
d = int(intput("Enter the element to be search for: "))
c = BINARYSEARCH(a,0, b-1 ,d)#Function calling
if(c !=-1): 
    print("Element found at index: ",c)
else: 
    print("Element not found")