Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
459 B
5
Indexable
Never
'''
Searches an element in a sorted array using Binary Search algorithm

Parameters:
    arr (list): A sorted list of integers where the element is to be searched
    low (int): The lowest index of the list from where to start the search
    high(int): The highest index of the list till where to perform the search
    x (int): The element to be searched in the list

Returns:
    The index of the element if present in the list else -1

Raises:
    None
'''