mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-18 22:40:59 +00:00
Fix multilingual content typos (#1958)
This commit is contained in:
@@ -35,7 +35,7 @@ public func binarySearchInsertion(nums: [Int], target: Int) -> Int {
|
||||
} else if nums[m] > target {
|
||||
j = m - 1 // target 在区间 [i, m-1] 中
|
||||
} else {
|
||||
j = m - 1 // 首个小于 target 的元素在区间 [i, m-1] 中
|
||||
j = m - 1 // 最右一个小于 target 的元素在区间 [i, m-1] 中
|
||||
}
|
||||
}
|
||||
// 返回插入点 i
|
||||
|
||||
@@ -26,8 +26,8 @@ enum Queue {
|
||||
|
||||
/* 元素出队 */
|
||||
// 使用 Array 模拟时 pop 的复杂度为 O(n)
|
||||
let pool = queue.removeFirst()
|
||||
print("出队元素 pop = \(pool),出队后 queue = \(queue)")
|
||||
let pop = queue.removeFirst()
|
||||
print("出队元素 pop = \(pop),出队后 queue = \(queue)")
|
||||
|
||||
/* 获取队列的长度 */
|
||||
let size = queue.count
|
||||
|
||||
Reference in New Issue
Block a user