Binary Search - Help Rahul - Pivot Element

At 3:00, Prateek bhaiya said if a[s]<=a[mid] then the array is sorted. But here the array is 1 4 5 3 2 and if we apply this condition then here the mid element is 5 and 1<5, but the array is not sorted. Please explain.

Hello @yajurkhurana that means the mid on which you currently are currently till that point the array is sorted and in this you can see the mid is 5 and 1<4<5. He means this that we wil now change our range . start from mid+1.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.