Skip to content

Commit 88d6c0c

Browse files
authored
remove reserved words
1 parent 32c900d commit 88d6c0c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sequential and binary search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def binary_search(target,raw_list):
3838
#binary search starts from the middle
3939
#if the middle value is larger, we search the lower half, vice versa
4040
#we do the same trick on the lower half recursively
41-
#note that right=len(list)+1 can handle both odd and even number case
42-
right=len(list)+1
41+
#note that right=len(raw_list)+1 can handle both odd and even number case
42+
right=len(raw_list)+1
4343
sorted_list=sorted(raw_list)
4444
found=False
4545

@@ -48,7 +48,7 @@ def binary_search(target,raw_list):
4848
#to get the middle point of any length
4949
#we need to get the half of the sum of first and last index
5050
#we use (left+right)//2 to get the middle value for any length
51-
#right=len(list)+1 can handle the odd number case
51+
#right=len(raw_list)+1 can handle the odd number case
5252
i=(left+right)//2
5353

5454
if sorted_list[i]==target:

0 commit comments

Comments
 (0)