mirror of
https://github.com/krahets/hello-algo.git
synced 2026-09-01 04:47:12 +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 is in the interval [i, m-1]
|
||||
} else {
|
||||
j = m - 1 // The first element less than target is in the interval [i, m-1]
|
||||
j = m - 1 // The rightmost element less than target is in the interval [i, m-1]
|
||||
}
|
||||
}
|
||||
// Return insertion point i
|
||||
|
||||
@@ -35,7 +35,7 @@ public func binarySearchInsertion(nums: [Int], target: Int) -> Int {
|
||||
} else if nums[m] > target {
|
||||
j = m - 1 // target is in the interval [i, m-1]
|
||||
} else {
|
||||
j = m - 1 // The first element less than target is in the interval [i, m-1]
|
||||
j = m - 1 // The rightmost element less than target is in the interval [i, m-1]
|
||||
}
|
||||
}
|
||||
// Return insertion point i
|
||||
|
||||
@@ -26,8 +26,8 @@ enum Queue {
|
||||
|
||||
/* Element dequeue */
|
||||
// When simulating with Array, pop complexity is O(n)
|
||||
let pool = queue.removeFirst()
|
||||
print("Dequeue element pop = \(pool), after dequeue queue = \(queue)")
|
||||
let pop = queue.removeFirst()
|
||||
print("Dequeue element pop = \(pop), after dequeue queue = \(queue)")
|
||||
|
||||
/* Get the length of the queue */
|
||||
let size = queue.count
|
||||
|
||||
Reference in New Issue
Block a user