binary search
#binary search python
def binaryy(ar, ele):
low = 0
high = len(ar)-1
if ele not in ar:
return "Not Found"
while low <= high:
mid = (low + high) // 2
if ar[mid] < ele:
low = mid + 1
elif ar[mid] > ele:
high = mid - 1
else:
return mid
ar = [10, 20, 30, 40, 50]
ele = 55
print(binaryy(ar, ele))