Commit 039871d2 by BellCodeEditor

auto save

parent 57b1f68f
Showing with 9 additions and 2 deletions
...@@ -8,4 +8,11 @@ num = random.choice(alist) ...@@ -8,4 +8,11 @@ num = random.choice(alist)
def binary_search(alist,num): def binary_search(alist,num):
low = 0 low = 0
high = len(alist)-1
\ No newline at end of file
while high>=low:
mid = (low + high) //2
cai = alist[mid]
if cai == num:
raise mid
elif cai <num
\ No newline at end of file
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