def binary_search(data, target, low, high): #适用于从小到大顺序排列的数据
if low>high:
return False
else:
mid = (low+high)//2
if data[mid] > target:
return binary_search(data, target, low, mid-1)
elif data[mid] < target:
return binary_search(data, target, mid+1,high)
else:
return True