From 8e37e8ff7a0d14e743b71c3cc55cc11d88f6278c Mon Sep 17 00:00:00 2001 From: GohJunLe <108907711+GohJunLe@users.noreply.github.com> Date: Sat, 3 Sep 2022 17:20:12 +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 7dec02c0..9817b3b4 100644 --- a/src/algorithms/search/exponential-search/exponentialSearch.js +++ b/src/algorithms/search/exponential-search/exponentialSearch.js @@ -21,7 +21,7 @@ function binarySearch(sortedArray, startIndex, endIndex, seekElement, comparator } // If element is smaller than middleIndex, then it can only be present n left subarray if (comparator.greaterThan(sortedArray[middleIndex], seekElement)) { - return binarySearch(sortedArray, startIndex, middleIndex-1, seekElement, comparatorCallback); + return binarySearch(sortedArray, startIndex, middleIndex - 1, seekElement, comparatorCallback); } // Else the element can only be present in right subarray return binarySearch(sortedArray, middleIndex + 1, endIndex, seekElement, comparatorCallback);