Skip to content

Commit 7bb1eb0

Browse files
committed
Correct the logic
1 parent 9220f3e commit 7bb1eb0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

data_structures/array/number_of_elements_that_can_searched_using_binary_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
So maintain two arrays - left_max and right_min such that in i'th index -
1010
1111
* left_max[i] contains the max element between 0 and i-1 (left to right movement)
12-
* right_min[i] contains the min element between n-1 and i+1 (right to left movement)
12+
* right_min[i] contains the min element between i+1 and n-1 (right to left movement)
1313
1414
Now for every element in the array, if its index its i, then it is binary searchable
1515
if left_max[i] < arr[i] < right_min[i]

0 commit comments

Comments
 (0)