Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit125b9ca

Browse files
committed
修复二分查找列表最右值返回False的问题
1 parentbb02fb7 commit125b9ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎Readme.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,13 +1205,14 @@ def binarySearch(l, t):
12051205
low= mid+1
12061206
else:
12071207
return mid
1208-
returnFalse
1208+
returnlowif l[low]== telseFalse
12091209

12101210
if__name__=='__main__':
12111211
l= [1,4,12,45,66,99,120,444]
12121212
print binarySearch(l,12)
12131213
print binarySearch(l,1)
12141214
print binarySearch(l,13)
1215+
print binarySearch(l,444)
12151216
```
12161217

12171218
##11 快排

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp