def binary_search(n,arr,ele):
    """
    Function to perform iterative binary search
    params:
        n   : Size of input array
        arr : input array
        ele : element to be searched in array
    returns:
        index : index of element if found else -1.
    """
    left = 0
    right = n-1
    while left<=right:
        mid = left + int((right-left)/2)
        if arr[mid] == ele:
            return mid
        elif ele > arr[mid]:
            left = mid+1
        else:
            right = mid-1
    return -1