mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
Update src/algorithms/search/exponential-search/exponentialSearch.js
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
This commit is contained in:
parent
1baf6106fd
commit
295fb99242
@ -44,7 +44,7 @@ export default function exponentialSearch(sortedArray, seekElement, comparatorCa
|
||||
if (sortedArray.length !== 0) {
|
||||
if (comparator.equal(sortedArray[0], seekElement))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
// Find range for binary search by repeated doubling
|
||||
let range = 1;
|
||||
while (range < length && comparator.lessThanOrEqual(sortedArray[range], seekElement)) {
|
||||
|
Loading…
Reference in New Issue
Block a user