Searching places

why we search the element between 4,5 and 2,3
like why we always try to find mid points between these two points why shouldnt we take complete array 4,5,1,2,3
and directly solve like why we make graph and try to approach through graph
please help me how we find mid points in this problem

hello @TheSourabh

In this problem the given array is rotated sorted array.
so we cannot directly apply our general binary search .
to make it work we need to change its implementation a bit.
that is why we are making graph to analyse different conditions.

binary search is divide n conqueer technique ,where based on some rules we discard some part of the array ,here also we are doing same (note initially we have considered complete array)

Mid point -> (s+e)/2

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.