mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-18 14:30:58 +00:00
Fix multilingual content typos (#1958)
This commit is contained in:
@@ -36,7 +36,7 @@ function binarySearchInsertion(nums: Array<number>, target: number): number {
|
||||
} 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
|
||||
@@ -50,7 +50,7 @@ console.log('\nArray nums = ' + nums);
|
||||
// Binary search for insertion point
|
||||
for (const target of [6, 9]) {
|
||||
const index = binarySearchInsertionSimple(nums, target);
|
||||
console.log('Element ' + target + ''s insertion point index is ' + index);
|
||||
console.log('Element ' + target + "'s insertion point index is " + index);
|
||||
}
|
||||
|
||||
// Array with duplicate elements
|
||||
@@ -59,7 +59,7 @@ console.log('\nArray nums = ' + nums);
|
||||
// Binary search for insertion point
|
||||
for (const target of [2, 6, 20]) {
|
||||
const index = binarySearchInsertion(nums, target);
|
||||
console.log('Element ' + target + ''s insertion point index is ' + index);
|
||||
console.log('Element ' + target + "'s insertion point index is " + index);
|
||||
}
|
||||
|
||||
export { binarySearchInsertion };
|
||||
|
||||
Reference in New Issue
Block a user