mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-11 18:27:03 +08:00
Polish some cotents.
This commit is contained in:
@@ -24,7 +24,7 @@ func binarySearch(nums []int, target int) int {
|
||||
}
|
||||
|
||||
/* 二分查找(左闭右开) */
|
||||
func binarySearch1(nums []int, target int) int {
|
||||
func binarySearchLCRO(nums []int, target int) int {
|
||||
// 初始化左闭右开 [0, n) ,即 i, j 分别指向数组首元素、尾元素+1
|
||||
i, j := 0, len(nums)
|
||||
// 循环,当搜索区间为空时跳出(当 i = j 时为空)
|
||||
|
||||
Reference in New Issue
Block a user