def bin_find(data, n): low = 0 high = len(data) - 1 while low <= high: mid = low + high // 2 if data[mid] == n: return mid elif data[mid] < n: low = mid + 1 elif data[mid] > n: high = mid - 1 return
标签:class blog 二分查找 post color data gpo col ==
def bin_find(data, n): low = 0 high = len(data) - 1 while low <= high: mid = low + high // 2 if data[mid] == n: return mid elif data[mid] < n: low = mid + 1 elif data[mid] > n: high = mid - 1 return
标签:class blog 二分查找 post color data gpo col ==
原文地址:https://www.cnblogs.com/colinshi/p/8431348.html