From 295fb99242e73fc569753e2b596c7f295b313d58 Mon Sep 17 00:00:00 2001 From: GohJunLe <108907711+GohJunLe@users.noreply.github.com> Date: Sat, 3 Sep 2022 17:17:30 +0800 Subject: [PATCH] Update src/algorithms/search/exponential-search/exponentialSearch.js Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com> --- src/algorithms/search/exponential-search/exponentialSearch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/search/exponential-search/exponentialSearch.js b/src/algorithms/search/exponential-search/exponentialSearch.js index 2c80d099..7dec02c0 100644 --- a/src/algorithms/search/exponential-search/exponentialSearch.js +++ b/src/algorithms/search/exponential-search/exponentialSearch.js @@ -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)) {