Find Minimum in Rotated Sorted Array
Find the minimum in a rotated sorted array with distinct values.
Why does this pattern fit?
Restate the exact job
Find the minimum in a rotated sorted array with distinct values.
Comparing mid with right reveals whether the rotation pivot is at mid or to its left/right.
O(log n) time · O(1) space
Using mid − 1 can discard the minimum itself.
How to solve Find Minimum in Rotated Sorted Array
The goal is to solve this problem from the pattern, not to memorize a finished answer. Use this as a check after your own attempt.
What the question asks
Find the minimum in a rotated sorted array with distinct values.
Why Binary search fits
Comparing mid with right reveals whether the rotation pivot is at mid or to its left/right.
State to maintain
An inclusive interval containing the minimum.
Transition
If mid > right, move left to mid + 1; otherwise keep mid by moving right to mid.
Time and space
O(log n) time · O(1) space
Counterexample to the tempting mistake
Using mid − 1 can discard the minimum itself.
Prove it again tomorrow
Close this page. Rebuild the state and transition from memory, write a test that exposes the mistake above, then solve a fresh input without looking back. A same-day reread is practice, not proof of retention.