Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT arr = [ 2 , 3 , 4 , 10 , 40 ] NEW_LINE n = len ( arr ) NEW_LINE x = 10 NEW_LINE result = randomizedBinarySearch ( arr , 0 , n - 1 , x ) NEW_LINE if result == - 1 : NEW_LINE INDENT print ( ' Element ▁ is ▁ not ▁ present ▁ in ▁ array ' ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' Element ▁ is ▁ present ▁ at ▁ index ▁ ' , result ) NEW_LINE DEDENT DEDENT