mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-25 22:46:20 +08:00
fix binary search typo (#1079)
Co-authored-by: Oleksii Trekhleb <trehleb@gmail.com>
This commit is contained in:
parent
729bc4d78a
commit
8959566a36
@ -11,7 +11,7 @@ import Comparator from '../../../utils/comparator/Comparator';
|
|||||||
|
|
||||||
export default function binarySearch(sortedArray, seekElement, comparatorCallback) {
|
export default function binarySearch(sortedArray, seekElement, comparatorCallback) {
|
||||||
// Let's create comparator from the comparatorCallback function.
|
// Let's create comparator from the comparatorCallback function.
|
||||||
// Comparator object will give us common comparison methods like equal() and lessThen().
|
// Comparator object will give us common comparison methods like equal() and lessThan().
|
||||||
const comparator = new Comparator(comparatorCallback);
|
const comparator = new Comparator(comparatorCallback);
|
||||||
|
|
||||||
// These two indices will contain current array (sub-array) boundaries.
|
// These two indices will contain current array (sub-array) boundaries.
|
||||||
|
Loading…
Reference in New Issue
Block a user