Commit d8bbb72f by BellCodeEditor

auto save

parent dd655c5e
Showing with 5 additions and 3 deletions
...@@ -10,6 +10,8 @@ high=len(alist)-1 ...@@ -10,6 +10,8 @@ high=len(alist)-1
def binary_search(alist,num): def binary_search(alist,num):
low=0 low=0
high=len(alist)-1 high=len(alist)-1
while : while low<=high:
mid=(high+low)//2 mid=(high+low)//2
if if alist[mid]==num:
\ No newline at end of file return mid
elif
\ 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