Skip to content

Commit 90356f3

Browse files
committed
Exponential Search : Fix 'value' is not defined error .
1 parent 74f2965 commit 90356f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Search/ExponentialSearch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
*
1010
*/
1111

12-
function binarySearch (arr, x, floor, ceiling) {
12+
function binarySearch (arr, value, floor, ceiling) {
1313
// Middle index
1414
const mid = Math.floor((floor + ceiling) / 2)
1515

1616
// If value is at the mid position return this position
17-
if (arr[mid] === x) {
17+
if (arr[mid] === value) {
1818
return mid
1919
}
2020

0 commit comments

Comments
 (0)