Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Compare mid element to the rightmost element. If mid is greater, the rotation point (minimum) must be to the right. Otherwise, it is at mid or to the left. Narrow until left meets right.
If mid element is greater than right element, the minimum must be in the right half (the rotation point is there). Otherwise, it is in the left half including mid.
Updated Feb 2026