Monotonic Function - Binary Search / Sorted Array

1 Like

Very nice insight and intuition! thanks

Very insightfully indeed!

grammar error. you guys said “A monontic” instead of monotonic in the first sentence under the graph

at this point, the subscription what I paid is rewarded.

The feasible function is supposed to be applied on the value not the index, right?
So based on my understanding, for example, in the python code on line 6, it should be feasible(arr[mid]) not feasible[mid]

Yes, I think there shoud be more clearly from definition of feasible function. In that ‘feasible’ function there could be extraction from an original array based on ‘mid’ index.

1 Like

But why not let mid = left + Math.floor((right - left) / 2)? for potential overflow
or i missing something?