python 插值查找
2021-06-20 11:03
标签:turn mes class als int arch lis sea else python 插值查找 标签:turn mes class als int arch lis sea else 原文地址:https://www.cnblogs.com/sea-stream/p/9689112.htmldef binary_search(lis, key):
low = 0
high = len(lis) - 1
time = 0
while low lis[mid]:
low = mid + 1
else:
#
print("times: %s" % time)
return mid
print("times: %s" % time)
return False
LIST = [1, 5, 7, 8, 22, 54, 99, 123, 200, 222, 444]
result = binary_search(LIST, 444)
print(result)
上一篇:python 基数排序
下一篇:初始JAVA中浅拷贝和深拷贝