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:
GohJunLe 2022-09-03 17:23:41 +08:00 committed by GitHub
parent 820492a8a8
commit f1d7c4b9aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ export default function exponentialSearch(sortedArray, seekElement, comparatorCa
// If element is present at first location itself // If element is present at first location itself
if (sortedArray.length !== 0) { if (sortedArray.length !== 0) {
if (comparator.equal(sortedArray[0], seekElement)) if (comparator.equal(sortedArray[0], seekElement))
return 0; }
} }
// Find range for binary search by repeated doubling // Find range for binary search by repeated doubling
let range = 1; let range = 1;