Skip to content

Commit 1191955

Browse files
author
AmiyahJo
committed
fix: binarySearch
misread the comment instructions and fixed the else statement
1 parent 2fcddb3 commit 1191955

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lesson_07/conditionals/src/lesson7.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ values: number[], start: number, end: number, value: number,
151151
} else if (values[pivotIndex] > value) {
152152
return binarySearch(values, start, pivotIndex - 1, value);
153153
} else {
154-
return binarySearch(values, start, pivotIndex + 1, end);
154+
return binarySearch(values, pivotIndex + 1, end, value);
155155
}
156156
// If values[pivotIndex] is equal to value then return `pivotIndex`.
157157
// Else if values[pivotIndex] is greater than the value, then

0 commit comments

Comments
 (0)