#算法基础之二分查找
def searchData(datasource,aim):
mid = int(len(datasource)/2)
if len(datasource) >= 1:
if datasource[mid] > aim:
print("datasource left:",datasource[:mid])
searchData(datasource[:mid],aim)
elif datasource[mid] < aim:
print("datasource right:",datasource[mid:])
searchData(datasource[mid:],aim)
else:
print("finddata:",datasource[mid])
else:
print("not found")
data = list(range(1,600000))
searchData(data,1)