Polish some cotents.

This commit is contained in:
krahets
2023-05-18 20:27:58 +08:00
parent 335bc29af2
commit 399e5df39a
16 changed files with 39 additions and 37 deletions

View File

@ -25,7 +25,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
var i = 0
var j = nums.count
@ -56,7 +56,7 @@ enum BinarySearch {
print("目标元素 6 的索引 = \(index)")
/* */
index = binarySearch1(nums: nums, target: target)
index = binarySearchLCRO(nums: nums, target: target)
print("目标元素 6 的索引 = \(index)")
}
}