Search in Rotated Sorted Array — binary search
The array is sorted then rotated, so one side of every midpoint is still in order. Check the target against that sorted side to know which way to go.
Try:
← Prev
Next →
▶ Play
Reset