Commit c5baa157 by BellCodeEditor

auto save

parent 47ae974e
Showing with 2 additions and 2 deletions
......@@ -8,8 +8,8 @@ num = random.choice(alist)
def binary_search(alist,num):
low=0 #定义变量
high=len(alist)-1
while low <= high: #
mid=(low+high)//2
while low <= high: #当最小的小于最大的时
mid=(low+high)//2 #找到中间值
guess=alist[mid]
if guess==num:
return mid
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment