mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
Merge e17e9b095a
into ca3d16dcce
This commit is contained in:
commit
bf37a9170d
@ -9,7 +9,7 @@ import Comparator from '../../../utils/comparator/Comparator';
|
|||||||
* @return {number}
|
* @return {number}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default function binarySearch(sortedArray, seekElement, comparatorCallback) {
|
export default const 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 lessThan().
|
// Comparator object will give us common comparison methods like equal() and lessThan().
|
||||||
const comparator = new Comparator(comparatorCallback);
|
const comparator = new Comparator(comparatorCallback);
|
||||||
|
Loading…
Reference in New Issue
Block a user