Standard Binary Search — Find `0`

Binary search is built on a single premise: “if the target is less than `arr[mid]`, eliminate the right half.” That rule is derived from global sortedness — the entire array runs smallest to largest, so a small target can only live to the left of a large midpoint. The rule is not a heuristic; it is a logical consequence of the sorted property.

Rotation strips that logical consequence away. 4567012 is NOT globally sorted. When mid points at 7 and the target is 0, the naive rule says “go left” — but 0 is to the right. The algorithm is not slow; it is wrong. Three confident steps, three wrong decisions, and it exits without ever visiting index 4. Before you can fix something, you need to see it fail.

4
5
6
7
0
1
2

Before we run it — standard binary search on 4567012 looking for 0. Will it find the target?